April 10th, 2025

Usability Improvements in GCC 15

GCC 15 introduces usability improvements, including enhanced execution path visualizations, structured C++ template error messages, dual output formats (text and SARIF), and detailed diagnostics for better developer experience.

Read original articleLink Icon
SatisfactionFrustrationEnthusiasm
Usability Improvements in GCC 15

GCC 15 introduces several usability improvements aimed at enhancing the user experience for developers. One significant enhancement is the improved visualization of execution paths, which now includes clearer warnings and ASCII art to illustrate control flow, making it easier to identify potential issues like infinite loops. Additionally, C++ template error messages have been revamped to present information in a more structured and readable format, reducing confusion for developers. The new output format uses indentation and bullet points to clarify the logical structure of error messages, which can significantly aid in debugging. Another notable feature is the support for machine-readable diagnostics in the SARIF format, allowing developers to receive compiler diagnostics in both traditional text and SARIF formats simultaneously. This dual output capability enhances the flexibility of how developers can analyze and utilize compiler feedback. Furthermore, GCC 15 improves the SARIF output by capturing detailed locations and source ranges associated with diagnostics, providing more context for errors. These enhancements collectively aim to streamline the development process and improve the overall usability of the GCC compiler.

- GCC 15 enhances execution path visualizations for clearer diagnostics.

- C++ template error messages are now structured for better readability.

- Support for dual output formats (text and SARIF) is introduced.

- SARIF output captures detailed locations and source ranges for errors.

- Overall improvements aim to streamline the development process.

AI: What people are saying
The comments reflect a mix of opinions on the usability improvements in GCC 15, particularly regarding error messaging and overall user experience.
  • Many users appreciate the enhanced template error messages and the hierarchical visualization of errors.
  • There are requests for more customization options, such as single-line error messages and configuration files.
  • Some users express nostalgia for older versions of GCC, indicating a preference for simplicity over new features.
  • Concerns about the inclusion of emojis in console output are raised, with some users finding them unnecessary.
  • Overall, there is a positive reception towards modernization efforts, with acknowledgment of past issues being addressed.
Link Icon 15 comments
By @munificent - 16 days
Using a hierarchy to show template errors is brilliant and I'm sort of surprised compilers haven't always done that.

I was investigating C++-style templates for a hobby language of mine and SFINAE is an important property to make them work in realistic codebases, but leads to exactly this problem. When a compile error occurs, there isn't a single cause, or even a linear chain of causes, but an potentially arbitrarily large tree of them.

For example, it sees a call to foo() and there is a template foo(). It tries to instantiate that but the body of foo() calls bar(). It tries to resolve that and finds a template bar() which it tries to instantiate, and so on.

The compiler is basically searching the entire tree of possible instantiations/overloads and backtracking when it hits dead ends.

Showing that tree as a tree makes a lot of sense.

By @mwkaufma - 16 days
Usability improvement request for this article: don't hijack the browser back button :P
By @porphyra - 16 days
With GCC error messages usually the only part I wanna see is "required from here" and yet it spams zillions of "note: ...". With the nesting enabled, it's way easier to read --- just look at the top indentation level. Hooray!!!
By @jmclnx - 16 days
I hope gcc remains the default in Linux due to the GPL. But I expect someday clang will become the default.

Plus I heard COBOL was merged in with the compiler collection, nice!

By @codeshaunted - 16 days
Big fan of all of this except for the emojis in my console
By @levodelellis - 16 days
Please gcc, let me have a `~/.config/gcc` config file or an ENV variable so I can ask for single lined error messages.

I literally do not need ascii art to point to my error, just tell me line:col and a unique looking error message so I can spend no more than 1 second understanding what went wrong

Also allow me to extend requires with my own error messages. I know it'll be non standard but it would be very nice tyvm

By @meisel - 16 days
The template error messages look great. I wonder if it’s worth writing a translator from clang/gcc messages to these ones, for users of clang and older gcc (to pipe one’s error messages to)
By @kazinator - 16 days
I can't imagine a piece of software easier to use than gcc 3.4.6, sorry.

We are now entering a Rococo period of unnecessarily ornate compiler diagnostics.

Getting these elaborate things to work is a nice puzzle, like Leetcode or Advent of Code --- but does it have to be merged?

By @Night_Thastus - 16 days
I'm all up for better error messaging. :)

Can't use Clang where I'm at, but I do get to use fairly cutting-edge GCC, at least for Windows development. So I may get to see these improvements once they drop into MSYS.

By @bmn__ - 16 days
The writer David Malcolm tells a story in his article about compiling C17 code and pretending it's C23. Duh, no wonder it breaks!

You C standard authors have it bass-ackwards. The version of the code must accompany the code, not the compiler invocation.

By @taschenorakel - 16 days
Why all this waste in Unicode art that nobody will ever see and that confuses your IDE.

Why not spend time on helping IDEs to understand error messages? That would be billion times more useful.

By @brcmthrowaway - 16 days
What is the status of GCC plugins?
By @jart - 16 days
Here's the pending GCC 15 release notes: https://gcc.gnu.org/gcc-15/changes.html (since the link in the article points to GCC 14)

- I'd love to see godbolt examples of the sort of optimizations [[unsequenced]] and [[reproducible]] can do.

- GCC has always been in my experience smart enough to know how to optimize normal C code into ROL and ROR instructions. I've never had any issues with it. So what's the point of __builtin_stdc_rotate_left()? Why create a builtin when it is not needed? What I wish GCC and Clang would do instead, is formally document the magic ANSI C89 incantations that trigger the optimization, e.g. `#define ROL(x, n) (((x) << (n)) | ((x) >> (64 - (n))))`. That way we can have clean portable code with less #ifdef hell along with assurances it'll go fast when -O is passed.

- What is "Abs Without Undefined Behavior (addition of builtins for use in future C library <stdlib.h> headers)."?

- What is "Allow zero length operations on null pointers"?

- Re: "Introduce complex literals." How about some __int128 literals?

- "The "redzone" clobber is now allowed in inline assembler statements" wooo I've wanted something like this for a while.

Great work from the greatest compiler team!

By @wiseowise - 16 days
Already looking forward to `grep`ing warning emojis in output. What's next? Poop emoji for errors?
By @budmichstelk - 16 days
I like a these modernization efforts in GCC, a lot of old niggles are gone now, and they've made a lot of new improvements I didn't think were possible/easy!