J
just80n
Hi all!
In C89 standard, the snprintf function is NOT included in <stdio.h>...
Thus, using snprintf in your code and compiling with gcc -ansi leads to
the following warning:
warning: implicit declaration of function `snprintf'"
In order to nicely get rid of this bad stuff, I intended to do
something like:
#if WE_ARE_COMPILING_USING_ANSI_C89_RULES
int snprintf(char *str, size_t size, const char *format, ...);
#endif
Which is defining the prototype of the function in case stdio.h won't
do it.
Question is : is there a symbolic constant
WE_ARE_COMPILING_USING_ANSI_C89_RULES defined by gcc, or do I have to
make it up myself, and how ?
thanx
(please, I m quite a newbie, so maybe I got totally wrong)
In C89 standard, the snprintf function is NOT included in <stdio.h>...
Thus, using snprintf in your code and compiling with gcc -ansi leads to
the following warning:
warning: implicit declaration of function `snprintf'"
In order to nicely get rid of this bad stuff, I intended to do
something like:
#if WE_ARE_COMPILING_USING_ANSI_C89_RULES
int snprintf(char *str, size_t size, const char *format, ...);
#endif
Which is defining the prototype of the function in case stdio.h won't
do it.
Question is : is there a symbolic constant
WE_ARE_COMPILING_USING_ANSI_C89_RULES defined by gcc, or do I have to
make it up myself, and how ?
thanx
(please, I m quite a newbie, so maybe I got totally wrong)