diff mbox series

[COMMITED] ada: Do not issue compiler warnings in GNATprove mode

Message ID 20221006092734.260579-1-poulhies@adacore.com
State New
Headers show
Series [COMMITED] ada: Do not issue compiler warnings in GNATprove mode | expand

Commit Message

Marc Poulhiès Oct. 6, 2022, 9:27 a.m. UTC
From: Yannick Moy <moy@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_prag.adb | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 0c3dd815263..f85d0919e7b 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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