News for hackers. Stuff that matters.
Re:Panic at the Job Market by mmaniac on Thursday July 18, 2024 @06:56AM (#40994385)
Yet GCC will still apparently let you call this function without as much as a warning. This should be one of the easiest mistakes to find statically.

Clang at least errors out here.

C++ is a mess.

Re:Panic at the Job Market by bregma on Thursday July 18, 2024 @12:31PM (#40997270)
Well, if the designer of the class used the right annotations GCC will issue a warning if warnings are enabled. This is third-party code and nothing to do with GCC per se and the language itself does not require any kind of compile-time warning for undefined behaviour. Then again, most people seem to disable or ignore the warnings the toolchain gives them. You can make anything idiot-proof but there's always a bigger idiot.

It sounds more like a crappy library designed by people who don't know their craft. It's easier to blame the tools.