Discussion:
warning: implicit declaration of function 'sym_forget' is invalid in C99
zhifeng yang
2014-01-08 19:21:04 UTC
Permalink
Hi all

I use the following command to compile a .c file and got the error as below.

cc -DIWORDSIZE=4 -DMAX_HISTORY=25 -DNMM_CORE=0 -c -g registry.c
registry.c:60:3: warning: implicit declaration of function 'sym_forget' is invalid in C99 [-Wimplicit-function-declaration]
sym_forget() ;

I am sure it is due to the cc flag. But I am not sure which flag causes this error. Can anybody help me? thank you

Bruce
Jeremy Lavergne
2014-01-08 19:25:46 UTC
Permalink
That warning (implicit function declaration) likely means the source code is using a function before having it defined. You’ll need to edit the source (fixes the cause), or ask clang to use an older c standard (fixes only the symptom).
Post by zhifeng yang
I use the following command to compile a .c file and got the error as below.
cc -DIWORDSIZE=4 -DMAX_HISTORY=25 -DNMM_CORE=0 -c -g registry.c
registry.c:60:3: warning: implicit declaration of function 'sym_forget' is invalid in C99 [-Wimplicit-function-declaration]
sym_forget() ;
I am sure it is due to the cc flag. But I am not sure which flag causes this error. Can anybody help me? thank you
bruceyoung01
2014-01-08 19:35:02 UTC
Permalink
The code is downloaded from online. Actually it's a model(WRF). There are
tons of similar warning is my comfile log file. Like the following

cc -DIWORDSIZE=4 -DMAX_HISTORY=25 -DNMM_CORE=0 -c -g registry.c
registry.c:60:3: warning: implicit declaration of function 'sym_forget' is
invalid in C99 [-Wimplicit-function-declaration]
sym_forget() ;
^
registry.c:132:3: warning: implicit declaration of function
'gen_io_boilerplate' is invalid in C99 [-Wimplicit-function-declaration]
gen_io_boilerplate() ; /* 20091213 jm. Generate the
io_boilerplate_temporary.inc file */
^
registry.c:134:3: warning: implicit declaration of function 'init_parser' is
invalid in C99 [-Wimplicit-function-declaration]
init_parser() ;
^
registry.c:157:8: warning: implicit declaration of function 'pre_parse' is
invalid in C99 [-Wimplicit-function-declaration]
if ( pre_parse( dir, fp_in, fp_tmp ) ) {
^
registry.c:177:3: warning: implicit declaration of function 'check_dimspecs'
is invalid in C99 [-Wimplicit-function-declaration]
check_dimspecs() ;




--
View this message in context: http://mac-os-forge.2317878.n4.nabble.com/warning-implicit-declaration-of-function-sym-forget-is-invalid-in-C99-tp240933p240935.html
Sent from the MacPorts - Users mailing list archive at Nabble.com.
bruceyoung01
2014-01-08 19:36:12 UTC
Permalink
how to specify old standard in the flag?



--
View this message in context: http://mac-os-forge.2317878.n4.nabble.com/warning-implicit-declaration-of-function-sym-forget-is-invalid-in-C99-tp240933p240936.html
Sent from the MacPorts - Users mailing list archive at Nabble.com.
Jeremy Lavergne
2014-01-08 19:39:25 UTC
Permalink
http://clang.llvm.org/docs/UsersManual.html#differences-between-various-standard-modes
Post by bruceyoung01
how to specify old standard in the flag?
Loading...