News for hackers. Stuff that matters.
Re:GCC undefined behaviors are getting wild by pjc50 on Monday November 28, 2022 @04:27AM (#33771427)
> Compiling and running as if nothing is amiss is exactly how UB is allowed to look like.

Yes, and this is a "billion-dollar mistake" that's responsible for an ongoing flow of CVEs.

(the proposal to replace "undefined" with "implementation-defined" may be the only way of fixing this, and that gets slightly easier to do as the number of actively maintained C implementations shrinks)

Re:GCC undefined behaviors are getting wild by imtringued on Monday November 28, 2022 @08:55AM (#33773670)
Create a Defined-C dialect.
Re:GCC undefined behaviors are getting wild by eru on Monday November 28, 2022 @08:35PM (#33782538)
You can already do that to some extent. There's tons of compiler flags that make C more defined. Eg both clang and gcc support `-fno-strict-overflow` to define signed integer overflow as wraparound according to two's complement.