GCC 14 Boasts Nice ASCII Art for Visualizing Buffer Overflows
phoronix.com
phoronix.com
https://news.ycombinator.com/item?id=39917509 - Improvements to static analysis in GCC 14 (redhat.com)
Still, I wonder if GCC is the best tool for this visualisation. Shouldn't it be in the realm of GDB, Valgrind, or other debuggers?
I actually like the use of the warning sign emoji too.
More details here: https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Format...
I hope my choices here work well on a wide variety of terminals.
Color is definitely one of the things that do NOT work well on a wide variety of terminals. try a white-on-firebrick VTE, or a black-on-darkgoldenrod (awesome for sun-glare, btw), white-on-green, white-on-purple for a change to see how well they mingle...
Sorry about that. I've filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114588 about this and I'll try to get it fixed before GCC 14 releases properly (i.e. for GCC 14.1)
Similar to “8-bit” art (which may be in a 24-bit colour space)
it is with great relief that I find ML people using lots of visual explaining rather than more weird 17th century crypto-language.
as a side-note Edward Tufte wrote a book called Visual Explanations: Images and Quantities, Evidence and Narrative. highly recommended and inspiration for above-mentioned approach.
It can catch easy one, not the obscures cases.
Edit: I also like the lib*san way of showing the variables and where everything is and is written to when you do oob writes but that is a whole other way of getting to it.
This isn’t me trying to be snarky, I actually have no idea! Reading a C++ template error is hard enough as a sighted person
You can see an example of the output here: https://godbolt.org/z/aan6Kfxds (that's the first example from the article, with -fdiagnostics-format=sarif-stderr added to the command-line options)
That doesn't cover the diagrams though (which I currently serialize in SARIF form by making a placeholder Markdown text containing "code" containing the diagram).
I experimented with SVG output for the diagrams, but didn't get this in good enough shape for GCC 14.
I've got a few ideas for more general UX improvements with how we do diagnostics, which I'll try in GCC 15 once we're finished focusing on GCC 14 bugfixing.
An advice to anyone out there making software: give a screen reader a whirl! Take it as a learning experience!
I like to ask this question on posts about new libraries or developer tools, because most developers don't consider the accessibility of the features they're building.