Hi;
I must be doing something very stupid.
Rosetta Code task “Weird Numbers”.
I’m on a Mac (M1 chip) using the GNAT compiler provded by Simon.
which gnatmake
/opt/gcc-14.2.0-3-aarch64/bin/gnatmake
the following is fom version #1 of the RC example:
gnatmake ./weird_numbers.adb
gcc -c -I./ -I- ./weird_numbers.adb
weird_numbers.adb:47:47: warning: value not in range of type "Ada.Containers.Vectors.Element_Type" from instance at line 11 [enabled by default]
weird_numbers.adb:47:47: warning: Constraint_Error will be raised at run time [enabled by default]
weird_numbers.adb:84:37: warning: value not in range of type "Ada.Containers.Vectors.Element_Type" from instance at line 11 [enabled by default]
weird_numbers.adb:84:37: warning: Constraint_Error will be raised at run time [enabled by default]
gnatbind -x weird_numbers.ali
gnatlink weird_numbers.ali
The following is from version #2:
gnatmake ./weird_numbers.adb
gcc -c -I./ -I- ./weird_numbers.adb
weird_numbers.adb:56:47: warning: value not in range of type "Ada.Containers.Vectors.Element_Type" from instance at line 10 [enabled by default]
weird_numbers.adb:56:47: warning: Constraint_Error will be raised at run time [enabled by default]
gnatbind -x weird_numbers.ali
gnatlink weird_numbers.ali
Since “pragma Ada_2022;” is at the top of both versions, I didn’t think I needed to provide and additional flags to the compile command; am I incorrect here?
RBE