tg icon indicating copy to clipboard operation
tg copied to clipboard

variable 'y' set but not used error while running "make" on mac os x

Open VityaSchel opened this issue 2 years ago • 4 comments

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)

VityaSchel avatar Sep 23 '22 18:09 VityaSchel

Same, seems like lot's of code is deprecated/outdated.

alloc33 avatar Oct 07 '22 03:10 alloc33

same on openSUSE

hrueschwein avatar Nov 12 '22 22:11 hrueschwein

so, there are three ways to fix that:

  1. delete variable y: that won't help, because variable y is used after, but somewhy gcc doesn't see that
  2. add (void) y; after y definition: will help, but there are other variables that also detected as unused
  3. delete -Werror from Makefile: imo best solution

however, it doesn't compiles in my env because of incomplete definition of type 'struct rsa_st' :))))))

hrueschwein avatar Nov 12 '22 22:11 hrueschwein

+1 on Ventura Version 13.0.1 (22A400)

dpnx-nudra avatar Dec 05 '22 14:12 dpnx-nudra