This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: signed is undefined and has been since 1992 (in GCC)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]