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-Thread: 103376,fd173879a595bde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc08.POSTED!20ae255c!not-for-mail Newsgroups: comp.lang.ada From: Anonymous Coward Subject: ADA/C interfaces: type representations uncontrollable in C References: Message-Id: User-Agent: slrn/0.9.7.4 (Linux) Date: Sat, 05 Nov 2005 16:35:51 GMT NNTP-Posting-Host: 141.149.78.234 X-Complaints-To: abuse@verizon.net X-Trace: trnddc08 1131208551 141.149.78.234 (Sat, 05 Nov 2005 11:35:51 EST) NNTP-Posting-Date: Sat, 05 Nov 2005 11:35:51 EST Xref: g2news1.google.com comp.lang.ada:6244 Date: 2005-11-05T16:35:51+00:00 List-Id: In article , Stephen Leake wrote: > > Hmm. You seem to be saying "convention (C) doesn't work for > me". That seems like a bug. Can you post some code that doesn't > work? Or have you submitted a bug report? I should start by saying that I think the compiler I witnessed this on is version 3.15p. I'll have to check on that. The pragma convention anomaly I've noticed relates to enums, not records. However, just because records have been represented in a sequence of elements that matches the operational spec doesn't mean I can count on it to work every time - it may have been chance. I'm beginning to realize that it's impossible to write compiler independant ADA code if it must interface with C code. Even rep spec'ing down to the bitwise rep specs makes no guarantess that the chosen layout will match what all C compilers produce (since they can potentially all be different). What I don't understand is how GNAT can give the user representation control over types, when C does not, considering that GNAT translates ADA to C. How does GNAT perform that intermediate C translation if rep specs don't exist in C?