public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] ada: Use explicit conversion to VString_Ptr
@ 2007-12-13 15:41 Samuel Tardieu
  2007-12-13 16:34 ` Arnaud Charlet
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Tardieu @ 2007-12-13 15:41 UTC (permalink / raw)
  To: gcc-patches

Replace .all'Unchecked_Access by an explicit conversion to VString_Ptr,
as is done in BreakX already.

    gcc/ada/
	* g-spipat.adb (Break): Use explicit conversion to VString_Ptr.
---
 gcc/ada/g-spipat.adb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gcc/ada/g-spipat.adb b/gcc/ada/g-spipat.adb
index 0e56f8a..dc487de 100644
--- a/gcc/ada/g-spipat.adb
+++ b/gcc/ada/g-spipat.adb
@@ -1812,7 +1812,7 @@ package body GNAT.Spitbol.Patterns is
    function Break (Str : not null access VString) return Pattern is
    begin
       return (AFC with 0,
-              new PE'(PC_Break_VP, 1, EOP, Str.all'Unchecked_Access));
+              new PE'(PC_Break_VP, 1, EOP, VString_Ptr (Str)));
    end Break;
 
    function Break (Str : VString_Func) return Pattern is
-- 
1.5.3.7

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ada: Use explicit conversion to VString_Ptr
  2007-12-13 15:41 [PATCH] ada: Use explicit conversion to VString_Ptr Samuel Tardieu
@ 2007-12-13 16:34 ` Arnaud Charlet
  2007-12-13 17:39   ` Samuel Tardieu
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaud Charlet @ 2007-12-13 16:34 UTC (permalink / raw)
  To: Samuel Tardieu; +Cc: gcc-patches, Robert Dewar

> Replace .all'Unchecked_Access by an explicit conversion to VString_Ptr,
> as is done in BreakX already.
> 
>     gcc/ada/
> 	* g-spipat.adb (Break): Use explicit conversion to VString_Ptr.

No, this change is wrong. We just did exactly the opposite of that for good
reasons, see the message I just sent on gcc-patches
([Ada] Fix accessibility error in GNAT.Spitbol.Patterns), and
see svn log/svn annotate.

Arno

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ada: Use explicit conversion to VString_Ptr
  2007-12-13 16:34 ` Arnaud Charlet
@ 2007-12-13 17:39   ` Samuel Tardieu
  2007-12-14  2:17     ` Robert Dewar
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Tardieu @ 2007-12-13 17:39 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc-patches, Robert Dewar

On 13/12, Arnaud Charlet wrote:

| > Replace .all'Unchecked_Access by an explicit conversion to VString_Ptr,
| > as is done in BreakX already.
| > 
| >     gcc/ada/
| > 	* g-spipat.adb (Break): Use explicit conversion to VString_Ptr.
| 
| No, this change is wrong. We just did exactly the opposite of that for good
| reasons, see the message I just sent on gcc-patches
| ([Ada] Fix accessibility error in GNAT.Spitbol.Patterns), and
| see svn log/svn annotate.

Ok, it got caught by the -gnatw.u warning; if Unchecked_Access is indeed
mandatory here, the -gnatw.u patch may be missing a corner case.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ada: Use explicit conversion to VString_Ptr
  2007-12-13 17:39   ` Samuel Tardieu
@ 2007-12-14  2:17     ` Robert Dewar
  2007-12-14  8:53       ` Arnaud Charlet
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Dewar @ 2007-12-14  2:17 UTC (permalink / raw)
  To: Samuel Tardieu; +Cc: Arnaud Charlet, gcc-patches

Samuel Tardieu wrote:
> On 13/12, Arnaud Charlet wrote:
> 
> | > Replace .all'Unchecked_Access by an explicit conversion to VString_Ptr,
> | > as is done in BreakX already.
> | > 
> | >     gcc/ada/
> | > 	* g-spipat.adb (Break): Use explicit conversion to VString_Ptr.
> | 
> | No, this change is wrong. We just did exactly the opposite of that for good
> | reasons, see the message I just sent on gcc-patches
> | ([Ada] Fix accessibility error in GNAT.Spitbol.Patterns), and
> | see svn log/svn annotate.
> 
> Ok, it got caught by the -gnatw.u warning; if Unchecked_Access is indeed
> mandatory here, the -gnatw.u patch may be missing a corner case.

This makes me worry about that patch. I really think we should redo this
using my approach, which is for sure reliable.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ada: Use explicit conversion to VString_Ptr
  2007-12-14  2:17     ` Robert Dewar
@ 2007-12-14  8:53       ` Arnaud Charlet
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaud Charlet @ 2007-12-14  8:53 UTC (permalink / raw)
  To: Robert Dewar; +Cc: Samuel Tardieu, gcc-patches

> >Ok, it got caught by the -gnatw.u warning; if Unchecked_Access is indeed
> >mandatory here, the -gnatw.u patch may be missing a corner case.
> 
> This makes me worry about that patch. I really think we should redo this
> using my approach, which is for sure reliable.

Agreed, sounds like the -gnatw.u warning is dangerous as it is.

Arno

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-14  8:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-13 15:41 [PATCH] ada: Use explicit conversion to VString_Ptr Samuel Tardieu
2007-12-13 16:34 ` Arnaud Charlet
2007-12-13 17:39   ` Samuel Tardieu
2007-12-14  2:17     ` Robert Dewar
2007-12-14  8:53       ` Arnaud Charlet

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).