From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6b77ce1ba18f9267 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-08 06:59:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Import a type from C Date: 08 Nov 2002 09:51:28 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3dca4583$0$299$bed64819@news.gradwell.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1036767746 15633 128.183.235.92 (8 Nov 2002 15:02:26 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 8 Nov 2002 15:02:26 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:30589 Date: 2002-11-08T15:02:26+00:00 List-Id: Robert A Duff writes: > "Frank J. Lhota" writes: > > > ...only the crude pack pragma / command line option ... > > What's the "pack pragma". Is this standard C, or something supported by > some C compilers? (Which compilers?) gcc supports "__attribute__ ((packed))". It applies to structs, or fields within structs (not arrays). I'm on a flight project that has a lot of inherited C code, and some new Ada code (all by me). The previous project used -fpacked command line flag for all the C code. But we are also switching operating systems, and the new one can't tolerate -fpacked. So we have to add __attribute__ ((packed)) all over the place. But some people want to run unit tests using Microsoft Visual C (why, I'm not sure :). So we use a #define to get rid of the __attribute__. I keep saying "see how much easier this is in Ada". Some of them are beginning to hear it :). -- -- Stephe