Top
Best
New

Posted by dmalcolm 4/10/2025

Usability Improvements in GCC 15(developers.redhat.com)
259 points | 223 commentspage 2
taschenorakel 4/10/2025|
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.

brcmthrowaway 4/10/2025||
What is the status of GCC plugins?
o11c 4/10/2025||
Is there any reason to ask this? GCC plugins have been good since 4.8. 4.5 lacked some essential features; 4.6 would be fine if not for the annoyance of trying to support a plugin that works across the C++ transition. Of course, you can just use the Python plugin to save yourself a lot of sanity ...
aseipp 4/10/2025||
They work. You can use them? They haven't gone anywhere and the Linux kernel relies on them extensively, among other things.
jart 4/11/2025||
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!

saagarjha 4/19/2025||
> 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.

Well they don’t commit to that happening, so they want to provide you with an alternative.

fuhsnn 4/11/2025||
> How about some __int128 literals

There are _BitInt literals (wb and uwb), look adequate https://godbolt.org/z/xjEEM5Pa4 despite clang's "is a C23 extension" noise.

jart 4/11/2025||
Wait I missed that. They finally implemented _BitInt? YESSS
wiseowise 4/10/2025||
Already looking forward to `grep`ing warning emojis in output. What's next? Poop emoji for errors?
johnisgood 4/10/2025||
I do not want any emojis from my compiler's output, heck, in my terminal in general. Please, do not make it the default behavior.

(BTW my terminal does not even support emojis.)

db48x 4/10/2025|||
Why would you grep for the emoji? The actual pattern you want to match is the standard format of the error message that proceeds it, which hasn’t changed in eons:

    my $line = "infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]";
    grammar gcc {
        token filename { <-[:]>+ };
        token linenumber { \d+ };
        token colnumber { \d+ };
        token severity { info|warning|error };
        token message { .* $$ };
        regex diagnostic {        <filename>
                           [\:]   <linenumber>
                           [\:]   <colnumber>
                           [\:]\s <severity>
                           [\:]\s <message>
                         };
        token TOP { <diagnostic> };
    }
    
    say gcc.parse($line);
which when run produces the obvious output:

    「infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」
     diagnostic => 「infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」
      filename => 「infinite-loop-linked-list.c」
      linenumber => 「30」
      colnumber => 「10」
      severity => 「warning」
      message => 「infinite loop [CWE-835] [-Wanalyzer-infinite-loop]」
I’ll leave handling filenames containing colons as an exercise for the reader.

The emoji just focus the reader’s eye on the most critical line of the explanation.

aseipp 4/10/2025|||
Why wouldn't you just keep search for the "warning:" or "error:" anchor, like people (and editors) have been doing forever? Even if that wasn't true it's not like searching for emojis is hard anyway. If it takes longer than 2 seconds for you to open a picker then you should ask for a refund for your computer.
OptionOfT 4/12/2025||
Same with their ‘’ quotation marks. I've had cases where I was searching for "'something'", and it didn't find anything, because it was printed as "‘something’".
budmichstelk 4/10/2025|
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!