comp.lang.ada
 help / color / mirror / Atom feed
* Re: Semantics of Inline vs non-Inline
@ 2004-10-18  6:29 Christoph Karl Walter Grein
  2004-10-20 15:07 ` Wojtek Narczynski
  0 siblings, 1 reply; 26+ messages in thread
From: Christoph Karl Walter Grein @ 2004-10-18  6:29 UTC (permalink / raw)
  To: comp.lang.ada

From: Wojtek Narczynski <wojtek@power.com.pl>

> > RM 13.3(15..18) specify the recommended level of support.
> 
> Those paragraphs do not mandate returning a rubbish address for unsuported
> cases. Also please note that if you use other attributes in context where
> it does not make sense, the compiler will tell you about it.

When you're going outside the recommended level of support, you're on your own and can't blame the compiler
vendor. It's a nice feature if you get a warning. And ACT is very open to proposals for better compiler messages.
(I do not know who the compiler vendor of the OP is.)

> > RM 13.3(13) says it's the programmer's responsibility to ensure the
> > address is valid.
> 
> "If an Address is specified, it is the programmer's responsibility to
> ensure that the address is valid; otherwise, program execution is
> erroneous."
> 
> This does not say anything about when 'Address produces correct result, it
> only says that in "for X'Address use <XXXXX>", you're supposed to provide
> correct <XXXXX>.

  function Push( Datum : Datum_Type ) return List.Cell_Ptr is
     LM_Datum : List.Datum_Type;
     for LM_Datum'Address use Datum'Address;

And here, no correct <XXXXX> is provided. So RM 13.3(13) is violated. Therefore the program is erroneous.

Erroneous means: The compiler need not detect this. If it doesn't, the program is free to do anything. The (in)famous
nasal demons :-)
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193




^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Semantics of Inline vs non-Inline
@ 2004-10-21 11:21 Christoph Karl Walter Grein
  2004-10-21 20:57 ` Wojtek Narczynski
  2004-10-22  0:46 ` skidmarks
  0 siblings, 2 replies; 26+ messages in thread
From: Christoph Karl Walter Grein @ 2004-10-21 11:21 UTC (permalink / raw)
  To: comp.lang.ada

> > "Not supported" means: Upon execution of your program, it's undefined what
> > will happen.
> 
> I am right now grepping the RM, and this is just not true. The RM defines
> in dozens of places what should happen if something is "not supported".
> For example, applicable to this case:
> 
> "13/1 A representation or operational item that is not supported by the
> implementation is illegal, or raises an exception at run time."

OK, I stand corrected. But didn't you say your procedure, when inlined, produced
an exception (and worked when not inlined)?

Only if it didn't, you have a point against your compiler vendor and should push his nose to
this pragraph.
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201




^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Semantics of Inline vs non-Inline
@ 2004-10-21  5:07 Christoph Karl Walter Grein
  2004-10-21 10:24 ` Wojtek Narczynski
  0 siblings, 1 reply; 26+ messages in thread
From: Christoph Karl Walter Grein @ 2004-10-21  5:07 UTC (permalink / raw)
  To: comp.lang.ada

> >   function Push( Datum : Datum_Type ) return List.Cell_Ptr is
> >      LM_Datum : List.Datum_Type;
> >      for LM_Datum'Address use Datum'Address;
> 
> Sorry, I still don't see why Datum'Address should compile if it is not supported.
> 
> Regards,
> Wojtek

Obviously you are not familiar with Ada RM speak:

"Not supported" means: Upon execution of your program, it's undefined what will happen.
If your compiler does not pass the argument with a valid address, your program is erroneous.
Full stop.

The RM also makes a distinction between "undefined" and "implementation defined".

But your program is legal syntax, so the compiler cannot reject it. As it cannot reject X := 1 / 0;

It might do you a favour and output a warning, though, but that's not required.
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193




^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Semantics of Inline vs non-Inline
@ 2004-10-15  6:18 Christoph Karl Walter Grein
  2004-10-15 11:02 ` Wojtek Narczynski
  0 siblings, 1 reply; 26+ messages in thread
From: Christoph Karl Walter Grein @ 2004-10-15  6:18 UTC (permalink / raw)
  To: comp.lang.ada

> 
The question here is not "Inline vs. not Inline", but "is 'Address attribute guaranteed to deliver 
correct results".

RM 13.3(13) says it's the programmer's responsibility to ensure the address is valid.
RM 13.3(15..18) specify the recommended level of support.

Your parameter "Datum: Datum_Type" is not in this list:
Datum_Type is not a by-reference type.

If your program works non-inlined, you are just lucky. Your compiler vendor is right.
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193




^ permalink raw reply	[flat|nested] 26+ messages in thread
[parent not found: <35f054ea.0410140733.5f250e6f@posting.google.com>]

end of thread, other threads:[~2004-10-22 12:57 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18  6:29 Semantics of Inline vs non-Inline Christoph Karl Walter Grein
2004-10-20 15:07 ` Wojtek Narczynski
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 11:21 Christoph Karl Walter Grein
2004-10-21 20:57 ` Wojtek Narczynski
2004-10-22  0:46 ` skidmarks
2004-10-22  5:50   ` Simon Wright
2004-10-22 12:57     ` Wojtek Narczynski
2004-10-21  5:07 Christoph Karl Walter Grein
2004-10-21 10:24 ` Wojtek Narczynski
2004-10-15  6:18 Christoph Karl Walter Grein
2004-10-15 11:02 ` Wojtek Narczynski
     [not found] <35f054ea.0410140733.5f250e6f@posting.google.com>
2004-10-14 16:14 ` Wojtek Narczynski
2004-10-14 20:05   ` Arthur Schwarz
2004-10-15 10:24     ` Wojtek Narczynski
2004-10-15 16:32       ` Arthur Schwarz
2004-10-14 17:58 ` Martin Krischik
2004-10-15  0:49   ` Arthur Schwarz
2004-10-15  8:05     ` Martin Krischik
2004-10-15 16:39       ` Arthur Schwarz
2004-10-15 16:40       ` Arthur Schwarz
2004-10-15 16:40       ` Arthur Schwarz
2004-10-15 16:45       ` skidmarks
2004-10-15  3:40 ` Steve
2004-10-15  5:50 ` Simon Wright
2004-10-15 16:57   ` skidmarks
2004-10-18 17:01 ` skidmarks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox