J
John Smith
Lets say you have a function "debug printf" which works like printf but will
get left out if _DEBUG flag is not defined along with the strings which are
to be printed.
Now I defined this:
#ifdef _DEBUG
void dbgprintf(char *szFormat, ...);
#else
#define dbgprintf
#endif
This works fine but under some compilers eg. gcc it will give me a huge
bunch of warnings saying the statement has no effect. This is ofcourse true,
but I don't need to be reminded since this was the intention. Does any of
you have good ideas how I can improve the macro to stop the compiler from
giving this?
Thanks in advance.
-- John
get left out if _DEBUG flag is not defined along with the strings which are
to be printed.
Now I defined this:
#ifdef _DEBUG
void dbgprintf(char *szFormat, ...);
#else
#define dbgprintf
#endif
This works fine but under some compilers eg. gcc it will give me a huge
bunch of warnings saying the statement has no effect. This is ofcourse true,
but I don't need to be reminded since this was the intention. Does any of
you have good ideas how I can improve the macro to stop the compiler from
giving this?
Thanks in advance.
-- John