-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
(This build is with aarch64-apple-darwin21 !!!, but I'm sure - without actually trying - that it'd be the same on x86_64.
Found on alire tag 1.1.2, same on master)
I get the following (edited to only show the warnings)
gnatcoll-io-remote-windows.adb:496:36: warning: pragma Unreferenced given for "Status" [enabled by default]
gnatcoll-io-remote-unix.adb:409:36: warning: pragma Unreferenced given for "Status" [enabled by default]
gnatcoll-io-remote-unix.adb:434:36: warning: pragma Unreferenced given for "Status" [enabled by default]
gnatcoll-utils.adb:618:34: warning: pragma Unreferenced given for "Result" [enabled by default]
gnatcoll-io-remote.adb:851:62: warning: pragma Unreferenced given for "Dead" [enabled by default]
gnatcoll-scripts-shell.adb:38:06: warning: unnecessary with of ancestor [-gnatwr]
clic-command_line.adb:2244:40: warning: pragma Unreferenced given for "Success" [enabled by default]
clic-command_line.adb:2461:71: warning: pragma Unreferenced given for "Success" [enabled by default]
alire-roots.adb:113:29: warning: pragma Unreferenced given for "Was_There" [enabled by default]
alire-hashes.ads:80:07: warning: unused variable "Char" in conjunct [-gnatw.t]
alire-hashes.ads:80:07: warning: consider extracting conjunct from quantified expression [-gnatw.t]
alire-solutions.adb:396:12: warning: unused variable "Solved" in disjunct [-gnatw.t]
alire-solutions.adb:396:12: warning: consider extracting disjunct from quantified expression [-gnatw.t]
alire-properties-actions-executor.ads:1:06: warning: unnecessary with of ancestor [-gnatwr]
alire-toml_load.adb:177:10: warning: pragma Unreferenced given for "Pins" [enabled by default]
alr-last_chance_handler.adb:3:06: warning: unnecessary with of ancestor [-gnatwr]
compilation of gnatcoll-io-remote.adb failed
compilation of gnatcoll-scripts-shell.adb failed
compilation of gnatcoll-utils.adb failed
compilation of gnatcoll-io-remote-unix.adb failed
compilation of gnatcoll-io-remote-windows.adb failed
compilation of alire-toml_load.adb failed
compilation of alire-properties-actions-executor.adb failed
compilation of alire-solutions.adb failed
compilation of alire-hashes.adb failed
compilation of alire-roots.adb failed
compilation of alr-last_chance_handler.adb failed
The gnatcoll problems arise because the Makefile defaults BUILD
to PROD
, but the GPR defaults it to DEBUG
.
The pragma Unreferenced given for
warnings are supposed to be fixed by changing the name of the variable that we are writing but not reading from Foo
to Dummy
or Unused
(could that be Dummy_Foo
or Unused_Foo
?)
The warnings in e.g. alire-hashes.ads
appear to be a genuine compiler problem: how is Char
not used in
function Is_Well_Formed (Hash_Img : String) return Boolean is
(for some Char of Hash_Img => Char = ':' and then
Is_Known (Utils.Head (Hash_Img, ':')));
We could build with -gnatw.T
, turn off warnings for suspicious contract.
I got round all this by suppressing all info/warnings with
gprbuild -j0 -Palr_env -XOS=macOS -gnatws