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

Andrew Pinski pinskia@physics.uc.edu
Tue Jun 28 04:50:00 GMT 2005


On Jun 28, 2005, at 12:34 AM, Gabriel Dos Reis wrote:

> The attitude that "undefined behaviour" should be interpreted
> as "we should not make things more useful when we can" is beyond
> understanding.

Then C/C++ aliasing rules go out the window really or maybe I 
misunderstand
what you are trying to say?

And what about casting functions to a different function type and 
calling
that, we just declared it as calling a trap in the last couple of years.
That is not very useful really.  What about var_args with shorts, that 
is
not useful but since it is undefined, we just call trap on it.

Or even sequence points, we get less of those bugs than C/C++ aliasing 
rules
violation but still get some even with documenting they are undefined 
and
change with optimizations.

The list can go on, with the current undefined behavior we have changed 
in
the recent years, past 5 years.  Part of C++ aliasing rules were not
implemented  until at least 3.3 which was only 2 years ago.

-- Pinski



More information about the Gcc mailing list