Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defined but not used variables in headers #115

Open
schwehr opened this issue May 8, 2019 · 0 comments
Open

defined but not used variables in headers #115

schwehr opened this issue May 8, 2019 · 0 comments

Comments

@schwehr
Copy link
Collaborator

schwehr commented May 8, 2019

Describe the bug

Variables defined with static in headers get put into compilation units where they aren't used.

To Reproduce

On debian testing for example:

gcc --version
gcc (Debian 7.3.0-18) 7.3.0
CFLAGS="-O2 -Wall -Wextra -Wshadow" ./configure --enable-test

gcc -DHAVE_CONFIG_H -I. -I../../src/mbio  -I../../src/mbio -I../../src/mbaux -I../../src/gsf  -I/usr/include/gmt -I/usr/include     -O2 -Wall -Wextra -Wshadow -MT mbinfo.o -MD -MP -MF $depbase.Tpo -c -o mbinfo.o mbinfo.c &&\
mv -f $depbase.Tpo $depbase.Po

[SNIP]

In file included from mbinfo.c:37:0:
At top level:
../../src/mbio/mb_io.h:147:14: warning: ‘mb_sensor_type_string’ defined but not used [-Wunused-variable]
 static char *mb_sensor_type_string[] = {"Unknown sensor type",
              ^~~~~~~~~~~~~~~~~~~~~
../../src/mbio/mb_io.h:123:12: warning: ‘mb_sensor_type_id’ defined but not used [-Wunused-variable]
 static int mb_sensor_type_id[] = {
            ^~~~~~~~~~~~~~~~~
../../src/mbio/mb_io.h:52:14: warning: ‘mb_platform_type_string’ defined but not used [-Wunused-variable]
 static char *mb_platform_type_string[] = {
              ^~~~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant