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

Warning escalated to error during aarch64 compilation #23

Open
samek-h opened this issue Aug 28, 2021 · 0 comments · May be fixed by #24
Open

Warning escalated to error during aarch64 compilation #23

samek-h opened this issue Aug 28, 2021 · 0 comments · May be fixed by #24

Comments

@samek-h
Copy link

samek-h commented Aug 28, 2021

When compiling (natively) on aarch64, -Wunused-const-variable gets promoted to error (due to -Werror):

$ make
gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6   -static -O0 -ggdb   -c -o cmos_rw.o cmos_rw.c
gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6   -static -O0 -ggdb   -c -o commands.o commands.c
gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6   -static -O0 -ggdb   -c -o io_rw.o io_rw.c
gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6   -static -O0 -ggdb   -c -o logic.o logic.c
gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6   -static -O0 -ggdb   -c -o misc.o misc.c
In file included from misc.c:33:                                                                                                                                                      
misc.c:261:29: error: ‘cpuid_params’ defined but not used [-Werror=unused-const-variable=]                                                                                            
  261 | MAKE_PREREQ_PARAMS_VAR_ARGS(cpuid_params, 3, 4, "<cpu> <function> [index]", 0);                                                                                               
      |                             ^~~~~~~~~~~~                                                                                                                                      
commands.h:77:36: note: in definition of macro ‘MAKE_PREREQ_PARAMS_VAR_ARGS’                                                                                                          
   77 |  static const struct prereq_params name_ = \                                                                                                                                  
      |                                    ^~~~~                                                                                                                                      
cc1: all warnings being treated as errors
make: *** [<builtin>: misc.o] Error 1

Can be supressed by appending -Wno-error=unused-const-variable to CFLAGS.
EDIT: can be fixed by making the creation of variadic parameters structure for command cpuid conditionally compiled in only for x86 - see #24 .

@samek-h samek-h linked a pull request Aug 28, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant