Going down the rabbit hole of variadic macros in glibc, I’ve reached /usr/lib/gcc/x86_64-linux-gnu/4.8.2/include/stdarg.h
where, for example, the va_start
macro is defined as:
#define va_start(v,l) __builtin_va_start(v,l)
But I’ve been trying to look for the actual implementation of __builtin_va_start(v,l)
without success. I’ve googled and grepped for it, and the furthest I’ve gotten to is Microsoft’s implementation for Visual Studio, which I suppose isn’t radically different.
Does anybody know where glibc implementation is?
TIA.
To look in the source code of gcc, download the matching version from http://www.netgull.com/gcc/releases/ For example, the 4.8.2 version is at http://www.netgull.com/gcc/releases/gcc-4.8.2/ (82 MB).
The builtin keyword is handled at line 4169 of gcc/builtins.c
In general, to find how gcc expands the built-in gcc function whose name is '__builtin_foo', look in the gcc source for the declaration of the function 'expand_builtin_foo'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With