Amend style switches (expand -gnatyg).#1497
Merged
Merged
Conversation
-gnatyg is "check standard GNAT style rules, same as ydISux", but in
GCC 14 it will include a new switch, -gnatyz (check parentheses not
required by operator precedence rules) which will mean that use of
extra parens to clarify intent without deep knowledge of the rules
will trigger fatal warnings; for example in alire-conditional_trees.adb
function Contains_ORs (This : Tree) return Boolean is
((not This.Is_Empty) and then This.Root.Contains_ORs);
^
Refer GCC Bugzilla PR 112446.
* alire_common.gpr (Style_Check_Switches): Remove -gnatyg and replace
by the pre-GCC 14 equivalent.
mosteo
approved these changes
Nov 14, 2023
Member
|
Thanks, Simon. |
mosteo
pushed a commit
to mosteo/alire
that referenced
this pull request
Nov 15, 2023
-gnatyg is "check standard GNAT style rules, same as ydISux", but in
GCC 14 it will include a new switch, -gnatyz (check parentheses not
required by operator precedence rules) which will mean that use of
extra parens to clarify intent without deep knowledge of the rules
will trigger fatal warnings; for example in alire-conditional_trees.adb
function Contains_ORs (This : Tree) return Boolean is
((not This.Is_Empty) and then This.Root.Contains_ORs);
^
Refer GCC Bugzilla PR 112446.
* alire_common.gpr (Style_Check_Switches): Remove -gnatyg and replace
by the pre-GCC 14 equivalent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-gnatygis (GCC <= 13) "check standard GNAT style rules, same as ydISux". Long-term, it would be better to use that set of rules explicitly rather than depending on a set of style rules outside our control.In GCC 14
-gnatygwill include a new switch,-gnatyz(check parentheses not required by operator precedence rules); refer GCC Bugzilla PR 112466.This change to
-gnatygwill mean that use of extra parens to clarify intent for readers who don’t have deep knowledge of the precedence rules will trigger warnings, fatal given-gnatwe; for example in alire-conditional_trees.adb