Re: Interfacing to C and long long data type



Sébastien Morand wrote:

Anyway when you interface Ada with C, you are loosing the portability of
your program.

OTOH, in particular when using GNAT's native targets, there
is a good chance that you loose very little when interfacing
with C (as Maciej explains)---without proper C interfacing
there is just no Ada program when the runtime relies on C
conventions anyway. It has to, because among the facts of
life, one is that an OS is typically written in C.[*]

When your target is not native, again, chances are that
the OS infrastructure on which to build your Ada program uses
C conventions.

I won't mention the load of useful libraries that are,
unfortunately, written in &*-language. I won't be able
to use these libraries when you insist on Ada Only portability.

A better appraoch would seem to isolate the interfacing
parts and use redundant representation clauses and a handful
of tests. Running the test will not be the same as a careful
analysis of matching C/Ada representations. But at least they
can draw attention to this important issue.


-- Georg
___
[*] Another fact is that working for an investment bank and
working for an adventure game team show the same traits
and effects of addiction. Could this play a part
in how OS software is written...
.


Loading