Re: varariable argument functions question (is there a data type for ... ? )

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 9, 2006, at 11:22 AM, Ingo Krabbe wrote:

Am Samstag, 9. September 2006 16:17 schrieb Charles Lambert:
Is there a datatype that represents variable arguments in variable
argument functions [e.g. int foo(int a, ...); ] ?
If so what is it, and what source file could i find it in?
I'm trying to make bindings to the objective-c runtime for ada on my
mac os x 10.4 and there is a line in it as such:
typedef id 			(*IMP)(id, SEL, ...);

IMP is used in several structs. Any help with this would be greatly
appreciated.

Thank you,
Charles Lambert

I don't know if there is something like a variadic function in ada. See for
example the vprintf how variadic functions are translated into normal
functions with a va_list argument.

It is defined that a function that has a variadic interface has to use the stdarg(3) macros to initialize and read the va_list structure. There are no annotations on how to implement variadic function mechanisms than to provide
the macros as defined in stdarg(3).

I guess i should have been more specific. I meant how does gcc
implement the variable arguments. I understand the va_start, va_arg, and va_end are macros. i'm interested in how va_list is implemented. ada doesn't allow variadic functions and if i can pass in a single datatype that is in the same form that the c runtime expects for the variable args. i can work around this issue. i did find std_expanded_builtin_va_start in builtins.c. it apears that va_list is represented as type tree
in that function (if i'm reading it correctly).
aside from that i haven't been able to figure out what is going on. I'm not even sure if that is remotely close to where i should be looking in the gcc source code.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux