ada: Do not issue compiler warnings in GNATprove mode
authorYannick Moy <moy@adacore.com>
Fri, 23 Sep 2022 15:14:52 +0000 (17:14 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 6 Oct 2022 09:22:48 +0000 (11:22 +0200)
Use of pragma Warning with a string literal to set warning
switches, should not impact GNATprove which is not subject
to these switches.

gcc/ada/

* sem_prag.adb (Analyze_Pragma): Ignore one variant of pragma
Warnings in GNATprove mode.

gcc/ada/sem_prag.adb

index 0c3dd81..f85d091 100644 (file)
@@ -25731,6 +25731,13 @@ package body Sem_Prag is
                        ("argument of pragma% must be On/Off or static string "
                         & "expression", Arg1);
 
+                  --  Use of pragma Warnings to set warning switches is
+                  --  ignored in GNATprove mode, as these switches apply to
+                  --  the compiler only.
+
+                  elsif GNATprove_Mode then
+                     null;
+
                   --  One argument string expression case
 
                   else