News for hackers. Stuff that matters.
Re:GCC undefined behaviors are getting wild by fps_doug on Monday November 28, 2022 @05:46AM (#33771987)
I can't really follow. What would be wrong with making -fwrapv the default? i.e. let the compiler assume signed integers are two's complement on according platforms (i.e. virtually everything in use today). Then stop assuming "a + 1 < a" cannot be true for signed ints. How would that make existing code worse, or break it? It's basically what you already get with -O0 afaict, so any such program would be broken with optimizations turned off.
Re:GCC undefined behaviors are getting wild by tuyiown on Monday November 28, 2022 @07:03AM (#33772562)
I think I misunderstood your comment, sorry, but I have difficulties in understanding how it's different that how things works already, then. You either have to rely that the compiler author did chose what you expect (not the case here), or check by yourself and hope it won't change.
Re:GCC undefined behaviors are getting wild by gpderetta on Monday November 28, 2022 @07:40AM (#33772865)
There is nothing wrong. Except that a subset of GCC users prefer -ftrapv and another subset wants no overhead, so the status quo remains.