I\'m trying to use C stdarg.h lib, with a generic type. The type int, is my generic type > to understand it, please, hold reading. So, my problem is:
I have a functi
Try u?intptr_t, which is defined in stdint.h. This is an integer which is guaranteed to be big enough to hold a pointer.
You might also want to think about what happens when you pass a floating point number; it is converted to and passed as a double. If your program is expecting an int this will destroy its view of the stack. Ouch. And the compiler cannot catch this.
And your function, as defined, has (barring any bit-encoding in paramN, in which case it should be an enum or bitfield, or, at least, unsigned) no way of knowing what the type of parameters it receives are, and as such is unlikely to be able to do anything useful with them. C has no run-time type information on its objects.
What, exactly, are you trying to do?