comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing Ada to C
@ 1997-05-29  0:00 Rune Wemberg
  1997-05-29  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rune Wemberg @ 1997-05-29  0:00 UTC (permalink / raw)




Hello!

In the Gnat reference manual, in the "Interfacing to C"
section, it says:

Packed Ada records map to C structures where all 
members are bit fields of the length corresponding
to the type'Size value in Ada.

Does anyone know what a packed Ada record is?

--
Rune Wemberg
ruw@ffi.no




^ permalink raw reply	[flat|nested] 11+ messages in thread
* Interfacing Ada to C
@ 1999-06-14  0:00 Drew
  0 siblings, 0 replies; 11+ messages in thread
From: Drew @ 1999-06-14  0:00 UTC (permalink / raw)


I've built a static library with C code using MS developer
studio.  When I use our DDCI Ada'83 compiler to link into
it, it works perfectly.  When I use Microsofts MSlink to
link the ada code into the C library, it works find.  When
I use GNAT (gcc) to link into the library, I have
problems.  Here's what's happening.

Ada call

Send_Message;

C code

void Test (void) {

printf("Inside test.");
}

void Send_Message (void) {

printf("Inside send message.");

//This works fine.  But when the C code calls another
//procedure inside the library, it crashes.  This only
//happens with the GNAT compiler.

test;
//it crashes here.
}

Does anyone know why this happens, and how to solve it???



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****




^ permalink raw reply	[flat|nested] 11+ messages in thread
* Interfacing Ada to C
@ 1999-06-14  0:00 Drew
  1999-06-14  0:00 ` Steve Quinlan
  0 siblings, 1 reply; 11+ messages in thread
From: Drew @ 1999-06-14  0:00 UTC (permalink / raw)


I've built a static library containing C code using MSDEV
Studio.  When I link into the library using our DDCI Ada'83
compiler, everything works fine.  If I use MSDEV's mslink
to link the Ada code into the library, it works fine.  When
I use GNAT (gcc), I have problems.  Here's what's happening.

Ada code

Send_Message;

C code

void test (void) {

printf("In test.\n");

}

void Send_Message (void) {

printf("In send message."\n);

//This works fine.

test;
//It crashes when I try and call test.
}

Does anyone know why this is happening, and how to fix it?
It's important that we use the GNAT compiler to link into
it.



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1999-06-14  0:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-29  0:00 Interfacing Ada to C Rune Wemberg
1997-05-29  0:00 ` Robert Dewar
1997-05-29  0:00 ` Samuel Tardieu
1997-05-30  0:00   ` Matthew Heaney
1997-05-31  0:00     ` Robert A Duff
1997-06-07  0:00       ` Robert Dewar
1997-05-30  0:00   ` Robert A Duff
1997-05-30  0:00 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1999-06-14  0:00 Drew
1999-06-14  0:00 Drew
1999-06-14  0:00 ` Steve Quinlan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox