GCC 14 Boasts Nice ASCII Art For Visualizing Buffer Overflows

3 years ago by ylai to c/c_lang

0x0 1 point 3 years ago

Aren't there compiler warnings for potential overflows already, that come in the form of warning: something when compiling? Aren't runtime overflows detected using the coredump in gdb, not gcc?

Shiny ASCII art seems like a waste of time and/or calling the dev stupid. What am i missing here?

path: 0 9072565, hotness: undefined, score: 1, children: 4
sajran 6 points 3 years ago

Well, I don't mind being called stupid if it makes my debugging easier. For many people visual/ graphical representation is much easier to comprehend than a block of text.

path: 0 9072565 9073251, hotness: undefined, score: 6, children: 3
0x0 1 point 3 years ago

It is, our brains are graphical. So is gdbs TUI. Is this another tool? 'Cos ASCII art in compiler output just seems odd to me.

path: 0 9072565 9073251 9073356, hotness: undefined, score: 1, children: 2
RonSijm 2 points 3 years ago

Not all features are for everyone. Maybe you're experienced enough that showing a graph seems like an overkill when you can just read the warnings.

But I can imagine for someone that's more entry level the graphs could make it easier to understand what the problem is

path: 0 9072565 9073251 9073356 9073732, hotness: undefined, score: 2, children: 0
sajran 1 point 3 years ago

I mean, it would probably make sense to make this optional to accommodate as many preferences as possible. I, for one, prefer to get the human readable message right away instead of having to use another tool for it.

path: 0 9072565 9073251 9073356 9073893, hotness: undefined, score: 1, children: 0
c_lang
c_lang

@programming.dev

login for more options
1359
104
35

Welcome to the C community!

C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.

© Dennis Ritchie

🌐 https://en.cppreference.com/w/c

go to feed...