This is the mail archive of the gcc-bugs@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]

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


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10719



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-15 19:44 -------
Here is the quote from the C standard, from a search of "va_arg undefined behavior promotion":
<http://lists.debian.org/debian-powerpc/2000/debian-powerpc-200010/msg00384.html>:
Here is the relevant part of ISO C Working Draft, 1997-11-21, WG14/N794 J11/97-158:

     7.12.1.2 The va_arg macro

     Synopsis

1               #include <stdarg.h>
                type va_arg(va_list ap, type);

     Description

2 The va_arg macro expands to an expression that has the type and value of the next
     argument in the call.  The parameter ap shall be the same as the va_list ap
     initialized by va_start.  Each invocation of va_arg modifies ap so that the values
     of successive arguments are returned in turn.  The parameter type is a type name
     specified such that the type of a pointer to an object that has the specified type can be
     obtained simply by postfixing a * to type.  If there is no actual next argument, or if
     type is not compatible with the type of the actual next argument (as promoted
     according to the default argument promotions), the behavior is undefined.


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