Email or username:

Password:

Forgot your password?
sam

GCC 14 is still in development, but it has a wonderful new feature in its static analyzer (-fanalyzer).

It can now draw beautiful Unicode diagrams showing exactly how you went out-of-bounds.

See inbox.sourceware.org/gcc-patch too.

Thank you to the wonderful David Malcolm for implementing this - who also does a tonne of work with mentoring for GCC's GSoC programme, and working on docs to help new people get into GCC: gcc-newbies-guide.readthedocs..

@gnutools

GCC command invoked as 'gcc-14 /tmp/foo.c -o /tmp/foo -fanalyzer'.

The source file, /tmp/foo.c, contains a trivial out-of-bounds read. The analyzer detects this and provides a colorful diagram illustrating where the out-of-bounds access occurs.
13 comments
wakame

@thesamesam @gnutools

For all the people who still held any illusions that they are good at writing C:

"Look, human. This is where your weird human brain decided to introduce a fence-post error again.
Here, I have drawn you a picture. Sorry, crayons were out." :blobcatgiggle:​

NixFREAK -

@thesamesam @gnutools oh awesome ... can't wait to try this out with gdb.

luna

@thesamesam this makes me C the issue quite clearly

sam

@egallager @gnutools A genuinely outstanding asset to GCC! I meant to name him in the post, and I'll edit it to now as well.

sam

I should also say that if you want a distribution that makes it very easy to have multiple GCCs installed at once and is recognised for its high-quality toolchain maintenance, you know where we are 😉

#gentoo

Go Up