diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2024-02-15 15:02:10 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-14 10:19:58 +0200 |
commit | 13d8374188eea21d56603135b6af254599c9e4b3 (patch) | |
tree | 4b1c6f750f1859ed8dca24cabf4cad84bc0d3d36 /gcc/ada/erroutc.ads | |
parent | 151d1533f2b5d1742ab08f99fcc67affae9587f5 (diff) | |
download | gcc-13d8374188eea21d56603135b6af254599c9e4b3.zip gcc-13d8374188eea21d56603135b6af254599c9e4b3.tar.gz gcc-13d8374188eea21d56603135b6af254599c9e4b3.tar.bz2 |
ada: Fix pragma Warnings and -gnatD interaction
A recent change broke pragma Warnings when -gnatD is enabled in some
cases. This patch fixes this by caching more slocs at times when it's
known that they haven't been modified by -gnatD.
gcc/ada/
* errout.adb (Validate_Specific_Warnings): Adapt to record
definition change.
* erroutc.adb (Set_Specific_Warning_On, Set_Specific_Warning_Off,
Warning_Specifically_Suppressed): Likewise.
* erroutc.ads: Change record definition.
Diffstat (limited to 'gcc/ada/erroutc.ads')
-rw-r--r-- | gcc/ada/erroutc.ads | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads index 250461f..1c43bce 100644 --- a/gcc/ada/erroutc.ads +++ b/gcc/ada/erroutc.ads @@ -347,11 +347,19 @@ package Erroutc is -- which is the pattern to match for suppressing a warning. type Specific_Warning_Entry is record - Start : Node_Id; + Start : Source_Ptr; Stop : Source_Ptr; -- Starting and ending source pointers for the range. These are always -- from the same source file. + Node : Node_Id; + -- Node for the pragma Warnings occurrence. We store it to compute the + -- enclosing subprogram if -gnatdJ is enabled and a message about this + -- clause needs to be emitted. Note that we cannot remove the Start + -- component above and use Sloc (Node) on message display instead + -- because -gnatD output can already have messed with slocs at the point + -- when warnings about ineffective clauses are emitted. + Reason : String_Id; -- Reason string from pragma Warnings, or null string if none |