public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/39446]  New: Can not resolve PUT between String and Character versions.
@ 2009-03-12 17:35 mark_r_eggleston at yahoo dot co dot uk
  2009-03-12 17:42 ` [Bug ada/39446] " mark_r_eggleston at yahoo dot co dot uk
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mark_r_eggleston at yahoo dot co dot uk @ 2009-03-12 17:35 UTC (permalink / raw)
  To: gcc-bugs

With two functions named get_name both returning string, the first function
having no parameter and the second an integer parameter.

This call:

Put(get_name);

is accepted by the compiler but this call

Put(get_name(7));

is rejected as ambiguous. The compiler refers the following possible
interpretations:

procedure Put (Item : Character);
procedure Put (Item : String);

I've written a simple test case referring to no external specifications with
two test procedures taking the place of Put.


-- 
           Summary: Can not resolve PUT between String and Character
                    versions.
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark_r_eggleston at yahoo dot co dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446


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

* [Bug ada/39446] Can not resolve PUT between String and Character versions.
  2009-03-12 17:35 [Bug ada/39446] New: Can not resolve PUT between String and Character versions mark_r_eggleston at yahoo dot co dot uk
@ 2009-03-12 17:42 ` mark_r_eggleston at yahoo dot co dot uk
  2009-03-12 17:44 ` mark_r_eggleston at yahoo dot co dot uk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mark_r_eggleston at yahoo dot co dot uk @ 2009-03-12 17:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mark_r_eggleston at yahoo dot co dot uk  2009-03-12 17:42 -------
Created an attachment (id=17451)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17451&action=view)
Simple test case program, version information.

No temporary files are include because the only temporary file produced only
contained the tile line.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446


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

* [Bug ada/39446] Can not resolve PUT between String and Character versions.
  2009-03-12 17:35 [Bug ada/39446] New: Can not resolve PUT between String and Character versions mark_r_eggleston at yahoo dot co dot uk
  2009-03-12 17:42 ` [Bug ada/39446] " mark_r_eggleston at yahoo dot co dot uk
@ 2009-03-12 17:44 ` mark_r_eggleston at yahoo dot co dot uk
  2009-03-17 14:28 ` sam at gcc dot gnu dot org
  2009-03-18  8:59 ` mark_r_eggleston at yahoo dot co dot uk
  3 siblings, 0 replies; 5+ messages in thread
From: mark_r_eggleston at yahoo dot co dot uk @ 2009-03-12 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mark_r_eggleston at yahoo dot co dot uk  2009-03-12 17:44 -------
In the test case program bug.adb functions a_string are substituted for
get_name functions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446


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

* [Bug ada/39446] Can not resolve PUT between String and Character versions.
  2009-03-12 17:35 [Bug ada/39446] New: Can not resolve PUT between String and Character versions mark_r_eggleston at yahoo dot co dot uk
  2009-03-12 17:42 ` [Bug ada/39446] " mark_r_eggleston at yahoo dot co dot uk
  2009-03-12 17:44 ` mark_r_eggleston at yahoo dot co dot uk
@ 2009-03-17 14:28 ` sam at gcc dot gnu dot org
  2009-03-18  8:59 ` mark_r_eggleston at yahoo dot co dot uk
  3 siblings, 0 replies; 5+ messages in thread
From: sam at gcc dot gnu dot org @ 2009-03-17 14:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from sam at gcc dot gnu dot org  2009-03-17 14:28 -------
This is not a bug. The compiler really has no way to distinguish between the
following two interpretations for "Put (Get_Name (7))":

  1- Get_Name (7) is a call to Get_Name with argument 7, which returns a String
  2- Get_Name (7) is a call to Get_Name without argument, which returns a
String, and you attempt to take the 7th character of this string, which is a
Character

Hence the ambiguity.


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446


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

* [Bug ada/39446] Can not resolve PUT between String and Character versions.
  2009-03-12 17:35 [Bug ada/39446] New: Can not resolve PUT between String and Character versions mark_r_eggleston at yahoo dot co dot uk
                   ` (2 preceding siblings ...)
  2009-03-17 14:28 ` sam at gcc dot gnu dot org
@ 2009-03-18  8:59 ` mark_r_eggleston at yahoo dot co dot uk
  3 siblings, 0 replies; 5+ messages in thread
From: mark_r_eggleston at yahoo dot co dot uk @ 2009-03-18  8:59 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2271 bytes --]



------- Comment #4 from mark_r_eggleston at yahoo dot co dot uk  2009-03-18 08:59 -------
Subject: Re:  Can not resolve PUT between String and Character versions.


Sam,

Thank you that make complete sense and explains why I could only reproduce this
problem with integers ans its sub types as the parameter.

I'd forgotten all about Ada array indexing and due to a limitation of the Ada
syntax the difference between a function call and accessing an array element
look identical which is why I suppose that there are named parameters available
in subprogram calls.

Had I been using Ada longer I would have recognised the ambiguity at thogh the
time it did look to me to be an obvious bug. I apologise for wasting your time.

--- On Tue, 17/3/09, sam at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>
wrote:

> From: sam at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>
> Subject: [Bug ada/39446] Can not resolve PUT between String and Character versions.
> To: mark_r_eggleston@yahoo.co.uk
> Date: Tuesday, 17 March, 2009, 2:28 PM
> 
> 
> ------- Comment #3 from sam at gcc dot gnu dot org 
> 2009-03-17 14:28 -------
> This is not a bug. The compiler really has no way to
> distinguish between the
> following two interpretations for "Put (Get_Name (7))":
> 
>   1- Get_Name (7) is a call to Get_Name with argument
> 7, which returns a String
>   2- Get_Name (7) is a call to Get_Name without
> argument, which returns a
> String, and you attempt to take the 7th character of this
> string, which is a
> Character
> 
> Hence the ambiguity.
> 
> 
> -- 
> 
> sam at gcc dot gnu dot org changed:
> 
>            What 
>   |Removed           
>          |Added
> ----------------------------------------------------------------------------
>              
>    CC|         
>                
>   |sam at gcc dot gnu dot org
>          
>    Status|UNCONFIRMED     
>            |RESOLVED
>          Resolution| 
>                
>           |INVALID
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39446


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

end of thread, other threads:[~2009-03-18  8:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 17:35 [Bug ada/39446] New: Can not resolve PUT between String and Character versions mark_r_eggleston at yahoo dot co dot uk
2009-03-12 17:42 ` [Bug ada/39446] " mark_r_eggleston at yahoo dot co dot uk
2009-03-12 17:44 ` mark_r_eggleston at yahoo dot co dot uk
2009-03-17 14:28 ` sam at gcc dot gnu dot org
2009-03-18  8:59 ` mark_r_eggleston at yahoo dot co dot uk

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