GCC 12.1 Released
GCC 12.1 Released
Posted May 8, 2022 23:45 UTC (Sun) by NYKevin (subscriber, #129325)In reply to: GCC 12.1 Released by ballombe
Parent article: GCC 12.1 Released
I remember reading in the comments of an otherwise-unrelated GCC bug[1] that ISO C says memcpy() is permitted to clobber errno, and that therefore gcc is technically required to either prove that errno is not used by the application code, or to emit extra instructions to save and restore the variable. The reaction from the gcc developers to this revelation could be paraphrased as "haha, no." Which isn't a terribly surprising response when you consider just how liberally gcc emits memcpy calls, but I found it amusing. So yes, they will deviate from the standard in cases where the standard is ridiculous or otherwise problematic.
