This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Ada] pragma Discard_Names for Restriction_Id
- From: Arnaud Charlet <charlet at adacore dot com>
- To: "Y.Tomino" <demoonlit at panathenaia dot halfmoon dot jp>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Dec 2006 16:13:04 +0100
- Subject: Re: [Patch, Ada] pragma Discard_Names for Restriction_Id
- References: <4555EF30.firstname.lastname@example.org>
> But, The "pragma Discard_Names;" in s-restri.ads doesn't work as
> intended. String images of Restriction_Id are included in my binary.
> This configuration pragma seems not to work well if it's not at the head
> of the file.
> I tested this patch on i686-pc-mingw32 with --disable-bootstrap.
> (I cannot build trunk without --disable-bootstrap on mingw.)
> Ok for mainline?
Sorry for answering late.
The patch is not OK, since it is only covering for a bug in the front-end.
The real bug is that pragma Discard_Names should reach inside inner scopes,
and should be fixed in sem_ch8.adb, e.g:
--- sem_ch8.adb 2006/12/11 16:22:01 1.764
+++ sem_ch8.adb 2006/12/24 10:41:34 1.765
@@ -5611,8 +5612,9 @@ package body Sem_Ch8 is
-- inner level subprograms do not inherit the categorization.
if Is_Library_Level_Entity (S) then
- Set_Is_Preelaborated (S, Is_Preelaborated (E));
+ Set_Is_Preelaborated (S, Is_Preelaborated (E));
Set_Is_Shared_Passive (S, Is_Shared_Passive (E));
+ Set_Discard_Names (S, Discard_Names (E));
Set_Categorization_From_Scope (E => S, Scop => E);