[Bug c/78868] When one variadic function calls another one, the parameters are reversed, if va_arg is used directly in function call.

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 20 01:26:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78868

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>  printf("%d, %d\n", __builtin_va_arg(args,int), __builtin_va_arg(args,int));


The order of execution here is not specified in the C standard.  So either of
the var_arg could be executed first.


More information about the Gcc-bugs mailing list