si.ads:38:01: warning: in instantiation at generic_si-generic_symbols-evaluate.adb:55 [enabled by default]
si.ads:38:01: warning: in instantiation at generic_si.adb:207 [enabled by default]
si.ads:38:01: warning: insufficient -O value [enabled by default]
What is an -O value?
package Generic_SI has a child unit Generic_SI.Generic_Symbols, which has a few separates, here Evaluate.
Generic_Symbols is instantiated as Symbols in package body Generic_SI.
Generic_SI itself is instantiated as SI.
package Symbols is new Generic_Symbols; – line 207 in generic_si.adb
package SI is new Generic_SI (Float, Actual_Dimensions); – line 38 in si.ads
It’s just a very cryptic warning, the executable runs, I cannot see any misbehaviour.
Looks like this is a warning, not error. The warning is issued by the compiler, not Alire itself. I found not much in search (https://stackoverflow.com/questions/3290235/ada-optimize-pragma). Probably the code contains pragma Optimise; but gcc is launched with -Ogand this doesn’t let the compiler to optimise the code. The -O option makes compiler optimise the code. By default there’s no optimisation ( the same as -O0). Alire sets -Og for development profile, this should be suitable for debugging, better than -O0. You can specify desired optimisation level while running Alire:
alr build – -O2
Or specify this in alire.toml
Does the warning prevent successful compilation/linking?
Your guess is correct, there is a pragma Optimize (Time); in the separate. So I see it’s compiled unoptimized.
As I said, it is only a warning, the executable is OK.
Thanks for your answer, it is spot on. I’m still in the first alire steps.
Christoph