AdaYaml
AdaYaml copied to clipboard
Question: Why is compiler package on yaml.gpr defined as it is?
In yaml.gpr I read
package Compiler is
for Default_Switches ("ada") use
("-gnat12", "-gnatwa", "-gnatwl", "-gnata", "-gnaty3abcefhiklmNprt", "-fstack-check");
case Mode is
when "debug" =>
for Default_Switches ("ada") use Compiler'Default_Switches ("ada") &
("-gnata", "-gnateE", "-E", "-g");
when "release" =>
for Default_Switches ("ada") use
("-O3" );
end case;
end Compiler;
Why does the release alternative on
https://github.com/yaml/AdaYaml/blob/b972e88f66fc664dd77c91cf230bbb8f2d0e2ece/yaml.gpr#L40
not contain
Compiler'Default_Switches ("ada") &
?
If it is done on purpose, why isn't it written as
package Compiler is
case Mode is
when "debug" =>
for Default_Switches ("ada") use
("-gnat12", "-gnatwa", "-gnatwl", "-gnata", "-gnaty3abcefhiklmNprt", "-fstack-check") &
("-gnata", "-gnateE", "-E", "-g");
when "release" =>
for Default_Switches ("ada") use
("-O3" );
end case;
end Compiler;
Thanks in advance for your explanation.
In addition: why is the flag "-gnata" that is already present in
for Default_Switches ("ada") use
("-gnat12", "-gnatwa", "-gnatwl", "-gnata", "-gnaty3abcefhiklmNprt", "-fstack-check");
added again in the debug mode
when "debug" =>
for Default_Switches ("ada") use Compiler'Default_Switches ("ada") &
("-gnata", "-gnateE", "-E", "-g");
In addition, why is -E offered to the compiler while it is an option of the Binder?
The answer to these questions is that I was sloppy when reviewing #12 and let this slip because it worked. You're welcome to make a PR improving this :).
To continue with flyx view on life, it was sloppy review before the pull request since the project-files wasn't the prioritized.