R
rick
I'm working on a disassembler for a school project.
Things work but I get compiler warnings as follows:
cc -W -Wall -pedantic -ansi main.c
defs.h:44: warning: 'blah' defined but not used
blah is a static variable, so visible only to defs.h (and files that
include defs.h?).
Without the static qualifier the compiler bails with
main.o: multiple definition of 'blah'
main.o: first defined here
collect2: ld returned 1 exit status
make: *** [all] Error 1
The warnings are invisible w/o the -Wall compile flag.
I just want to know if there is a way to declare 'blah' that will avoid
the warning.
here is the program structure:
FILE: main.c
#include dis.h
/* only calls one function in dis.h */
FILE: dis.h
#include defs.h
FILE: dis.c
#include dis.h
/* uses almost everything in defs.h */
FILE: defs.h
static const char* blah[ SIZE ] = { ... };
Like I said, I'm just looking to compile cleanly with the CFLAGS above.
thanks for any help!
Things work but I get compiler warnings as follows:
cc -W -Wall -pedantic -ansi main.c
defs.h:44: warning: 'blah' defined but not used
blah is a static variable, so visible only to defs.h (and files that
include defs.h?).
Without the static qualifier the compiler bails with
main.o: multiple definition of 'blah'
main.o: first defined here
collect2: ld returned 1 exit status
make: *** [all] Error 1
The warnings are invisible w/o the -Wall compile flag.
I just want to know if there is a way to declare 'blah' that will avoid
the warning.
here is the program structure:
FILE: main.c
#include dis.h
/* only calls one function in dis.h */
FILE: dis.h
#include defs.h
FILE: dis.c
#include dis.h
/* uses almost everything in defs.h */
FILE: defs.h
static const char* blah[ SIZE ] = { ... };
Like I said, I'm just looking to compile cleanly with the CFLAGS above.
thanks for any help!