c/10719: invalid code generated (x86, "int $5") with __builtin_va_arg(va, char);

sbiallas@online-club.de sbiallas@online-club.de
Mon May 12 14:06:00 GMT 2003


>Not a bug.  This is in fact a feature.  As you
note, the code
>is bad and you should use "int".  There is no
sensible code
>that could be generated.

I can't agree with this: gcc shouldn't generate
invalid code on purpose. It knows there is an
error and should generate an error and not a
warning. The warning is misleading (it sounds like
gcc found a problem and corrected it) and will
probably not recognized.

With the same attitude you could easily allow
instantiating a class with abstract functions and
segv when an abstract function is called.

Additionally "int $5" is a very bad way of
indicating bad code. This would for example
trigger a "print screen" on DOS or could even be a
syscall on other systems.

Regards,
Sebastian



More information about the Gcc-bugs mailing list