Mail Archives: djgpp/2003/04/22/07:30:03
Gisle Vanem <giva AT bgnett DOT no> wrote:
[...]
> Yes, I know. I use "x = (char) va_arg(arg,int)" to stop gcc complaining.
That's the wrong way of looking at this. It's not the complaint from
GCC you have to stop here. It's the undefined behaviour that will be
caused by the illegal C you posted before.
> But my question is why the "int $5" is generated. I guess it's meant to
> generated some trap on some system.
You're asking the wrong question, then. Fix your broken code, and it
won't happen. You don't have to know why this particular thing
happened, in this particular case. The compiler would be allowed to
insert the binary time-of-day into the code in such cases, just for
the fun of it. Or whatever else it finds in a random position in your
garbage can.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -