Page 1 of 1

Implementing Variadic Functions

Posted: Wed Nov 28, 2012 12:18 pm
by Geometrian
Hi,

I am trying to get variadic functions working in my kernel. This constitutes an implementation of stdarg.h, yes? Am I going about that the right way?

Thanks,

Re: Implementing Variadic Functions

Posted: Wed Nov 28, 2012 12:23 pm
by bluemoon
If you use gcc cross compiler, you may just #include <stdarg.h>, the compiler handle the dirty work for you.
You should not implement va_ macro/function yourself, it is just not necessary and not portable.

By the way, it is generally not a good idea to use variadic functions in kernel, except for debug purpose (aka. kprintf)