Discussion:
c compile error on implicit declaration
Gmail
2013-12-11 07:25:59 UTC
Permalink
Hi all

I am trying to compile the c code and got the following error.

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() ;
^

Do anybody have any ideas on it?

Thank you
Bruce
Juhász Ádám
2013-12-11 08:23:06 UTC
Permalink
Usually this means, that you (in the code) forgot to include a header for
(in this case) "sym_forget()" system function, but the compiler recognised
which header you forgot to include and got it covered for you. This its
only a warning and you can ignore it but should consider this to fix this
in your code for higher compatibility with the c language and to avoid
errors caused by this, like it didn't imported the right header for
instance.
Is this your "c code", a library you've downloaded or is this gcc as in the
c compiler?
Post by Gmail
Hi all
I am trying to compile the c code and got the following error.
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() ;
^
Do anybody have any ideas on it?
Thank you
Bruce
_______________________________________________
macports-users mailing list
https://lists.macosforge.org/mailman/listinfo/macports-users
bruceyoung01
2014-01-08 19:39:38 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/c-compile-error-on-implicit-declaration-tp238890p240937.html
Sent from the MacPorts - Users mailing list archive at Nabble.com.
Continue reading on narkive:
Loading...