From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Arnaud Charlet <charlet@adacore.com>
Subject: [COMMITTED] ada: Bad handling of ASCII with -gnatyn
Date: Tue, 16 May 2023 10:40:01 +0200 [thread overview]
Message-ID: <20230516084001.1501211-1-poulhies@adacore.com> (raw)
From: Arnaud Charlet <charlet@adacore.com>
ASCII is special cased but this wasn't taking into account all cases
such as Standard.ASCII.
gcc/ada/
* snames.ads-tmpl (Name_ASCII): New.
* style.adb (Check_Identifier): Fix handling of ASCII.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/snames.ads-tmpl | 1 +
gcc/ada/style.adb | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 8f71ad98db3..afe7508ac28 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -260,6 +260,7 @@ package Snames is
-- Some miscellaneous names used for error detection/recovery
+ Name_ASCII : constant Name_Id := N + $;
Name_Const : constant Name_Id := N + $;
Name_Error : constant Name_Id := N + $;
Name_False : constant Name_Id := N + $;
diff --git a/gcc/ada/style.adb b/gcc/ada/style.adb
index 3014359acba..dda5cd47c06 100644
--- a/gcc/ada/style.adb
+++ b/gcc/ada/style.adb
@@ -35,9 +35,8 @@ with Nlists; use Nlists;
with Opt; use Opt;
with Sinfo; use Sinfo;
with Sinfo.Nodes; use Sinfo.Nodes;
-with Sinfo.Utils; use Sinfo.Utils;
with Sinput; use Sinput;
-with Stand; use Stand;
+with Snames; use Snames;
with Stylesw; use Stylesw;
package body Style is
@@ -201,7 +200,7 @@ package body Style is
else
-- ASCII is all upper case
- if Entity (Ref) = Standard_ASCII then
+ if Chars (Ref) = Name_ASCII then
Cas := All_Upper_Case;
-- Special handling for names in package ASCII
--
2.40.0
reply other threads:[~2023-05-16 8:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230516084001.1501211-1-poulhies@adacore.com \
--to=poulhies@adacore.com \
--cc=charlet@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).