Re:C++20, How Hard Could It Be
by hi_herbert on Sunday September 25, 2022 @07:41AM
(#32970475)
I wonder how up to date is the old belief of better error messages.
The was some great redhat blogs about structured error messages in newer GCC.
GCC has gotten better indeed, but it's still in a different league than Clang. I still get into situations where I can't make heads-or-tails of what GCC is saying to me, which can usually be easily solved by switching to Clang.
One problem here is that GCC emits certain warnings as part of the optimizer, which results in many false positives that are essentially impossible for the lay programmer to understand. For example, jump threading might duplicate some code path and propagate constants in it, and then warn about an uninitialized variable / out of range access / etc in that code-path, even though it does not exist in that form in the original program.
Re:C++20, How Hard Could It Be
by MauranKilom on Sunday September 25, 2022 @03:03PM
(#32974814)
Funny enough, this is exactly the kind of situation where other people cry "why did the compiler not warn me about basing optimizations on UB".
Re:C++20, How Hard Could It Be
by hi_herbert on Sunday September 25, 2022 @08:27AM
(#32970683)
I don't do C++ anymore but I will forever remember the Vtable hell "messages" when doing OOP and doing a slight unintuitive mistake about destructor or constructor.
Is this still a thing in clang?
Ok, that's kinda true I suppose; I remember that GCC's error messages have indeed gotten better after a major version release.
Also, when you say structured, do you mean errors over LSP, or do you mean more structure in the formatting when reporting in CLI?
GCC returns pretty nice, colored and structured error messages in CLI for quite some time.
Re:C++20, How Hard Could It Be
by hi_herbert on Sunday September 25, 2022 @08:28AM
(#32970690)
I meant in cli a bit like rust arrows logs
clang doesn't output asm
And theoretically clang has better ASM output in some cases I say theoretically, because it's been shown that GCC's "worse" ASM performs better; I'm not really an architecture aficionad, so I can't comment as to why that is.
Also, it's been a few years now since I did C/C++. So, maybe these are no longer the case.
Anyway, I've kinda pointed out what I like about clang over gcc, but I'd be curious what you prefer in gcc.