From: "Frank J. Lhota" <NOSPAM.lhota.adarose@verizon.net>
Subject: Re: Import a type from C
Date: Thu, 07 Nov 2002 16:03:48 GMT
Date: 2002-11-07T16:03:48+00:00 [thread overview]
Message-ID: <E9wy9.30929$t1.2884@nwrddc02.gnilink.net> (raw)
In-Reply-To: 3dca4583$0$299$bed64819@news.gradwell.net
Thinking over my previous experience with this type of work, I would go with
the advice of using a representation clause. In general, a representation
clause should be used whenever a type cooresponds to data external to the
Ada program. This eliminates any concern about how this or that compiler
lays out a record.
Ada programmers are blessed with the whole chapter 13 support. C / C++ has
only the crude pack pragma / command line option to control the layout of a
struct. Is there any C compiler that automatically generates a decription of
how it lays out a struct? If I declare
typedef struct tag_mydata {
char lead;
long total;
unsigned year : 12;
unsigned month : 4;
unsigned day : 5;
} mydata;
is there a C compiler that has a command line option that will generate a
listing that shows the byte offset of the total member from the start of a
"mydata" struct, or the location of the bits that make up the month member?
Neither gcc nor MSVC++ has such an option, which would make this work much
easier.
next prev parent reply other threads:[~2002-11-07 16:03 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
2002-11-07 16:03 ` Frank J. Lhota [this message]
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