https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112446

            Bug ID: 112446
           Summary: Switch -gnatyz included in -gnatyg
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56538
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56538&action=edit
Demonstrator

"gnatmake --help" states that -gnatyg is equivalent to -gnatydISux, but 
in fact the new switch -gnatyz (check parentheses not required by operator 
precedence rules) is included.

If this is deliberate, the help information should say so.

(Personally, I think that clarifying parens are a valuable help to the 
reader! Are the GNAT Style Rules published?)

Given this (see the attachment),

   procedure P (P1, P2 : Boolean) is
      Dummy : Boolean;
   begin
      Dummy := (P1) or P2;
   end P;

this happens:

   $ /opt/gcc-14.0.0-20231105/bin/gnatmake -gnatyg p.adb
   gcc -c -gnatyg p.adb
   p.adb:4:13: (style) redundant parentheses [-gnatyz]

Reply via email to