From 04273a8dbbd2eebed18975bb39eb6457e66ff2ef Mon Sep 17 00:00:00 2001 From: Simon Wright Date: Tue, 14 Nov 2023 13:05:36 +0000 Subject: [PATCH] Amend style switches (expand -gnatyg). (#1497) -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. --- alire_common.gpr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alire_common.gpr b/alire_common.gpr index f1a2c269..217159f3 100644 --- a/alire_common.gpr +++ b/alire_common.gpr @@ -24,9 +24,12 @@ abstract project Alire_Common is case Style_Check_Mode is when "enabled" => Style_Check_Switches := ("-gnatwe", -- Warnings as errors - "-gnatyg", -- Standard checks + "-gnatyd", -- no DOS line terminators "-gnatyI", -- no IN mode "-gnatyO", -- all overrides + "-gnatyS", -- separate lines after THEN/ELSE + "-gnatyu", -- no unnecessary blank lines + "-gnatyx", -- no extra parens around conditionals "-gnaty-s"); -- relax fwd decl when "disabled" => Style_Check_Switches := (); end case; -- 2.39.5