I'm trying to write (and debug) a module for a library. All functions have to be statics so they don't show up as one of the library's symbols. Unfortunatly this also prevents their names from showing up in any backtraces.
Now I'm either looking for a simple way to switch between a debug compile where those functions are non-static and a build where they are marked static - or a way to make statics show up in my backtraces (glibc:backtrace()). I figured the former should be simple......
For other debug functions I used the usual ((void)0) macros, so the obvious thing was to try something like...
(I named the macro "_static" instead of "static" because I don't want this to affect statics-in-a-function)Code:#ifdef DEBUG #define _static ((void)0) [...] #else #define _static static [...] #endif
As you might have already guessed, ((void)0) doesn't seem to be working for me in this case. I'm getting tons of errors like
So the question would be how to make a macro that does exactly nothing, or how would I tell gcc not to strip names for static symbols (the manual didn't help me, btw).Code:client.c:3023: error: Syntaxfehler before "void" client.c:3024: error: Syntaxfehler before '(' token