Operating System - HP-UX
1753830 Members
9610 Online
108806 Solutions
New Discussion юеВ

Re: __builtin_va_start not defined

 
Don Rosengrant
Occasional Advisor

__builtin_va_start not defined

Hi all,
I have an application that calls va_start() and am using aCC V A.03.50. A sample is attached. When I compile the program with:

aCC -o hello hello.c

I get the error:

Error 328: "hello.c", line 9 # Function '__builtin_va_start' has not been
defined yet; cannot call.
va_start (args);
^^^^^^^^
However if I look in varargs.h I can see where it seems to be declared. I had tried the same program with ver A.03.25 and it goes through the compile phase but ld cores with signal 11, Segmentation Fault. Anybody have an idea?

Thanks.

Don
4 REPLIES 4
Michael Schulte zur Sur
Honored Contributor

Re: __builtin_va_start not defined

Hi,

look here:
http://www.mkssoftware.com/docs/man3/va_start.3.asp

I think you miss:
#include

greetings,

Michael
Don Rosengrant
Occasional Advisor

Re: __builtin_va_start not defined

Michael,
If I use that I get:

Warning 134: "hello.c", line 10 # Expected 2 arguments for macro 'va_start'.
va_start (args);
^^^^^^^^
Error 20: "hello.c", line 10 # '' expected before ')'.
va_start (args);
^^^^^^^^
Error 280: "hello.c", line 10 # Operator & expects lvalue operand.
va_start (args);
^^^^^^^^
The confusing thing is that stdarg.h includes and and that's all it does. varargs.h includes . Therefore I would expect the same behavior as just including but it's not.

It compiles with the softbench cc compiler we previously were using with -Aa option if I take out the __cplusplus reference and it works with the Solaris compiler.

I'm confused.

Thanks.
Don
Michael Schulte zur Sur
Honored Contributor

Re: __builtin_va_start not defined

Hi,

this function expects two arguments. Look at the link, I posted.

greetings,

Michael
Don Rosengrant
Occasional Advisor

Re: __builtin_va_start not defined

Michael,
After I sent the message, I was looking at the previous versions of varargs.h we were using. va_start() had 1 argument. The HP version with softbench uses __builtin_va_start() which has 2 args. It looks like it expects the 2nd param to be provided by the user and va_start() has 1 param.

It looks like a migration issue.

Thanks for your help.
Don