Implementing Variadic Functions

Programming, for all ages and all languages.
Post Reply
Geometrian
Member
Member
Posts: 77
Joined: Tue Nov 20, 2012 4:45 pm
Contact:

Implementing Variadic Functions

Post 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,
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Implementing Variadic Functions

Post 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)
Post Reply