PolMine / RcppCWB

'Rcpp' Bindings for the 'Corpus Workbench' (CWB)
Other
2 stars 3 forks source link

new warning "variable set but not used" (nr_targets) #83

Closed ablaette closed 1 year ago

ablaette commented 1 year ago

clang -arch arm64 -c -o sgml-print.o -Wall -O3 -arch arm64 -mtune=native -DUSE_TERMCAP -DCOMPILE_DATE=\""Fr 23 Jun 2023 09:19:43 CEST"\" -DCWB_VERSION=\"3.4.33\" -I/opt/homebrew/Cellar/glib/2.76.3/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.76.3/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/opt/homebrew/Cellar/pcre2/10.42/include sgml-print.c sgml-print.c:398:7: warning: variable 'nr_targets' set but not used [-Wunused-but-set-variable] int nr_targets; ^ 1 warning generated. clang -arch arm64 -c -o html-print.o -Wall -O3 -arch arm64 -mtune=native -DUSE_TERMCAP -DCOMPILE_DATE=\""Fr 23 Jun 2023 09:19:43 CEST"\" -DCWB_VERSION=\"3.4.33\" -I/opt/homebrew/Cellar/glib/2.76.3/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.76.3/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/opt/homebrew/Cellar/pcre2/10.42/include html-print.c html-print.c:463:7: warning: variable 'nr_targets' set but not used [-Wunused-but-set-variable] int nr_targets; ^ 1 warning generated. clang -arch arm64 -c -o latex-print.o -Wall -O3 -arch arm64 -mtune=native -DUSE_TERMCAP -DCOMPILE_DATE=\""Fr 23 Jun 2023 09:19:43 CEST"\" -DCWB_VERSION=\"3.4.33\" -I/opt/homebrew/Cellar/glib/2.76.3/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.76.3/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/opt/homebrew/Cellar/pcre2/10.42/include latex-print.c latex-print.c:437:7: warning: variable 'nr_targets' set but not used [-Wunused-but-set-variable] int nr_targets; ^ 1 warning generated.

clang --version

Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: arm64-apple-darwin22.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

ablaette commented 1 year ago

I think this is a false positive: Commenting out the lines reported by the warning results in undefined symbol errors, and indeed the variables are used. For the time being, I think this is a clang bug.

ablaette commented 1 year ago

This suggests that the warning is intended: https://www.redhat.com/en/blog/new-warnings-and-errors-clang-15