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-07 05:49:40 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: 07 Nov 2002 08:47:54 -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 1036677534 11611 128.183.235.92 (7 Nov 2002 13:58:54 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 7 Nov 2002 13:58:54 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:30522 Date: 2002-11-07T13:58:54+00:00 List-Id: 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