------- Comment #17 from redi at gcc dot gnu dot org 2010-08-11 11:55 ------- As already stated, what you are doing is not valid C or C++, the standards do not guarantee the behaviour you are expecting w.r.t stack layout, and an optimising C or C++ compiler follows the rules of the language standard. If you want to rely on your assumptions write assembler or do not enable optimisation.
(In reply to comment #13) > Created an attachment (id=21453) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21453&action=view) [edit] > Source file (example 2) > // linux (cannot use stdarg because this function does not take variable > parameters and > // so the compiler generates an error (shouldn't it be a warning?). Have you checked how va_start is defined? void va_start(va_list ap, parmN); ... The parameter parmN is the identifier of the rightmost parameter in the variable parameter list in the function definition (the one just before the , ...). You use *format_address as parmN, which is not an identifier. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45249