]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix crash with -gnatdJ and -gnatw.w
authorRonan Desplanques <desplanques@adacore.com>
Tue, 13 Feb 2024 10:04:00 +0000 (11:04 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 14 May 2024 08:19:56 +0000 (10:19 +0200)
commit34aba1547d277eb8c7fa5db7f58e35b1726693df
tree00d2b9911a4fa64d1172cdc7acad1a0c469b12eb
parent062626502fd5d56cd19c5e20c19f2d7cc2c03986
ada: Fix crash with -gnatdJ and -gnatw.w

This patch fixes a crash when -gnatdJ is enabled and a warning
must be emitted about an ineffective pragma Warnings clause.

Some modifications are made to the specific warnings machinery so
that warnings carry the ID of the pragma node they're about, so the
-gnatdJ mechanism can find an appropriate enclosing subprogram.

gcc/ada/

* sem_prag.adb (Analyze_Pragma): Adapt call to new signature.
* erroutc.ads (Set_Specific_Warning_Off): change signature
and update documentation.
(Validate_Specific_Warnings): Move ...
* errout.adb: ... here and change signature. Also move body
of Validate_Specific_Warnings from erroutc.adb.
(Finalize): Adapt call.
* errout.ads (Set_Specific_Warning_Off): Adapt signature of
renaming.
* erroutc.adb (Set_Specific_Warning_Off): Adapt signature and
body.
(Validate_Specific_Warnings): Move to the body of Errout.
(Warning_Specifically_Suppressed): Adapt body.
gcc/ada/errout.adb
gcc/ada/errout.ads
gcc/ada/erroutc.adb
gcc/ada/erroutc.ads
gcc/ada/sem_prag.adb