comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Import a type from C
Date: 07 Nov 2002 08:47:54 -0500
Date: 2002-11-07T13:58:54+00:00	[thread overview]
Message-ID: <uof918p9x.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3dca4583$0$299$bed64819@news.gradwell.net

porton@ex-code.com (Victor Porton) writes:

> May be specifying both
> 
> pragma Convention( C, My_Data );
> and
> pragma Pack( My_Type );
> 
> will be compatible with gcc -fpacked?

Well, it might, but the standard doesn't say. Actually, I would hope
the compiler would reject this, since it is asking for conflicting
things. 

I guess my real point is that the standard does _not_ clearly state
what Convention (C, ...) really means (it is entirely implementation
dependent), so I can't rely on it.

Ada is supposed to be easy to _read_, not necessarily easy to _write_.
Convention (C) is just a shortcut for the proper rep clause.

Hmm. I guess if you have two Ada compilers, and two corresponding C
compilers, and you use the correct command line flags on the C
compilers, and the corresponding rep clauses are different, then
Convention C is a better alternative than gnatprep to choose the
representation. However, in my experience, I end up needing gnatprep
(for other reasons) in a situation like that anyway.

-- 
-- Stephe



  reply	other threads:[~2002-11-07 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 19:48 Import a type from C Francisco Santoyo
2002-11-06 20:06 ` Frank J. Lhota
2002-11-06 23:10   ` Stephen Leake
2003-01-08 20:46     ` Rupert Pigott
2003-01-10  3:48       ` Eric G. Miller
2003-01-14  4:47       ` David Thompson
2002-11-07  7:16 ` Victor Porton
2002-11-07 13:47   ` Stephen Leake [this message]
2002-11-07 16:03   ` Frank J. Lhota
2002-11-07 16:20     ` Robert A Duff
2002-11-08 14:51       ` Stephen Leake
2002-11-07 19:00 ` chris.danx
2002-11-08  4:02 ` Victor Porton
replies disabled

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