tg
tg copied to clipboard
variable 'y' set but not used error while running "make" on mac os x
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/usr/local/include -I/opt/local/include -I/opt/local/include -I/usr/local/include/lua5.4 -I/usr/local/opt/openssl/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/generate.d -MQ objs/generate.o -o objs/generate.o tgl/generate.c
tgl/generate.c:330:7: error: variable 'y' set but not used [-Werror,-Wunused-but-set-variable]
int y;
^
1 error generated.
make: *** [objs/generate.o] Error 1
macOS Monterey 12.2.1 (21D62)
Same, seems like lot's of code is deprecated/outdated.
same on openSUSE
so, there are three ways to fix that:
-
delete variable
y
: that won't help, because variable y is used after, but somewhy gcc doesn't see that -
add
(void) y;
after y definition: will help, but there are other variables that also detected as unused -
delete
-Werror
from Makefile: imo best solution
however, it doesn't compiles in my env because of incomplete definition of type 'struct rsa_st'
:))))))
+1 on Ventura Version 13.0.1 (22A400)