-
snprintf warning error
Hi,
im getting the following warning during compiling. gol.c:568: warning: implicit declaration of function `snprintf'.
snprintf is probably not apart of standard C and since I was told to use the following flags during compilation; -o gol -ansi -Wall -g, im getting this warning. Is there anyway i can remove this warning and maintain the flags or is this error because of something else completely.
Thanks
-
The warning means that you've forgotten to include <stdio.h>
Also, warnings can be as or more important than errors - don't silence the compiler without very good reasons.
-
but i did.. ive got the following includes
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
Check out your stdio.h file for snprintf prototype. It should have been included there, If not you might get this error.
If you see one there, then the warning should be something else related snprintf.
ssharish2005
-
snprintf was not part of C90, it's a C99 addition or an extension to C90 available to certain compilers.
It looks like you may be using some variant of gcc, so try adding the flag -std=c99.