signed is undefined and has been since 1992 (in GCC)
Gabriel Dos Reis
gdr@integrable-solutions.net
Sat Jul 2 18:59:00 GMT 2005
Florian Weimer <fw@deneb.enyo.de> writes:
| * Robert Dewar:
|
| > I am puzzled, why would *ANYONE* who knows C use int
| > rather than unsigned if they want wrap around semantics?
|
| Both OpenSSL and Apache programmers did this, in carefully reviewed
| code which was written in response to a security report. They simply
| didn't know that there is a potential problem. The reason for this
| gap in knowledge isn't quite clear to me.
|
| Probably it's hard to accept for hard-code C coders that a program
| which generates correct machine code with all GCC versions released so
| far (modulo bugs in GCC) can still be illegal C and exhibit undefined
We need to be careful not to to substitute "illegal" for "undefined
behaviour". GCC is not a court.
Part from that, I maintain that we should not apply "undfeined
behaviour" whole sale.
-- Gaby
More information about the Gcc
mailing list