comp.lang.ada
 help / color / mirror / Atom feed
* pragma Convention questions
@ 2007-11-11 16:39 Samuel Tardieu
  2007-11-11 19:14 ` Martin Krischik
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Samuel Tardieu @ 2007-11-11 16:39 UTC (permalink / raw)


I have several questions regarding pragma Convention in Ada95 for
language lawyers.

1- pragma Convention on private types in language-define packages

Is it allowed for a compiler implementor to use a pragma Convention
on a private type in a language-defined package?

For example, would it be allowed to use

  pragma Convention (C, chars_ptr);

in the private part of Interfaces.C.Strings? (the real motive to this
question is to get rid of a warning in GNAT about conversion between
pointers of different conventions -- the type is already compatible
with C as per RM B3.1(1))

2- pragma Convention, renaming and Intrinsic

Is the following code legal?

package U is
   type Foo is (Foo1, Foo2);
   function F return Foo renames Foo1;
   pragma Convention (Ada, F);
   type Foo_Access is access function return Foo;
   X : Foo_Access := F'Access;
end U;

GNAT rejects X initialization with 'prefix of "Access" attribute
cannot be intrinsic'. Which means that the pragma Convention failed
silently. Is it allowed to have it fail without a compilation error?
Or is the 'Access legal?

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/



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

end of thread, other threads:[~2007-11-15  7:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-11 16:39 pragma Convention questions Samuel Tardieu
2007-11-11 19:14 ` Martin Krischik
2007-11-11 20:57   ` Samuel Tardieu
2007-11-12  8:14     ` Martin Krischik
2007-11-12  8:30       ` Samuel Tardieu
2007-11-12 17:02 ` Adam Beneschan
2007-11-12 21:54   ` Samuel Tardieu
2007-11-15  5:06 ` Randy Brukardt
2007-11-15  7:55   ` Samuel Tardieu

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