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

va_start behaving strange


I have an interesting problem with this compiler:


g++ (GCC) 3.4 20031007 (experimental) It is configured as powerpc-chorusos-elf.


In one of my C++ source files I invoke


va_start( args , fmt );


I get an error message:


__builtin_saveregs not supported by this target


I looked for the definition of the va_start macro and it looks like it is a compiler builtin. (Because "#define va_start" in the first line gives me a redefinition warning.)

I searched the gcc list and found this:

http://gcc.gnu.org/ml/gcc/2001-04/msg00705.html

So I replaced the line in question to read:


__builtin_va_start( args , fmt );



Now I get another rather confusing error message:


.....Id.C:1332: error: cannot convert `__va_list_tag*' to `__va_list_tag*' for argument `1' to `void __builtin_va_start(__va_list_tag*, ...)'


Hmmmm. I strongly suspect I am dealing with a bug here, but maybe I do not use va_start in the right way. Any headers that must be included? I currently include these:

#include	<cstring>
#include	<cstdlib>	// atoi
#include	<cstdio>	// vsnprintf
#include	<cstdarg>	// printf arguments


Maybe the order is significant?



Thanks in advance for any hints!


Gabor


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