Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why is compiler package on yaml.gpr defined as it is? #17

Open
pjljvandelaar opened this issue Jan 14, 2022 · 4 comments
Open

Comments

@pjljvandelaar
Copy link

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

("-O3" );

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.

@pjljvandelaar
Copy link
Author

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");

@pjljvandelaar
Copy link
Author

pjljvandelaar commented Jan 14, 2022

In addition, why is -E offered to the compiler while it is an option of the Binder?

@flyx
Copy link
Collaborator

flyx commented Jan 14, 2022

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 :).

@persan
Copy link
Contributor

persan commented Jan 20, 2022

To continue with flyx view on life, it was sloppy review before the pull request since the project-files wasn't the prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants