Hi,

4.2.2014 16:20, Tobias Ulmer wrote:
On Tue, Feb 04, 2014 at  04:36:22AM -0500, Mayuresh Kathe wrote:
>> hello.adb gnatbind -x hello.ali gnatlink hello.ali
>> /usr/local/lib/gcc/x86_64-unknown-openbsd5.4/4.6.4/adalib/libgnat.a(adaint.o)(.text+0x3f3):
>> In function `__gnat_os_filename':
>> /usr/obj/gcc-4.6.4/build-amd64/gcc/ada/rts/adaint.c:714: warning:
>> strcpy() is almost always misused, please use strlcpy()
>> /usr/local/lib/gcc/x86_64-unknown-openbsd5.4/4.6.4/adalib/libgnat.a(cstreams.o)(.text+0x12c):
>> In function `__gnat_full_name':
>> /usr/obj/gcc-4.6.4/build-amd64/gcc/ada/rts/cstreams.c:237: warning:
>> strcat() is almost always misused, please use strlcat()
>> /usr/local/lib/gcc/x86_64-unknown-openbsd5.4/4.6.4/adalib/libgnat.a(adaint.o)(.text+0x1c8):
>> In function `__gnat_try_lock':
>> /usr/obj/gcc-4.6.4/build-amd64/gcc/ada/rts/adaint.c:552: warning:
>> sprintf() is often misused, please use snprintf()

For OpenBSD 4.5 and gcc 4.3, I managed to get rid of most of these
warnings. You can see my custom port at
http://sourceforge.net/p/gnuada/code/HEAD/tree/trunk/OpenBSD/current/lang/gcc/

relevant patches are here:
http://sourceforge.net/p/gnuada/code/HEAD/tree/trunk/OpenBSD/current/lang/gcc/4.3/patches/

For example:
http://sourceforge.net/p/gnuada/code/HEAD/tree/trunk/OpenBSD/current/lang/gcc/4.3/patches/patch-gcc_ada_adaint_c

In addition, many buffers are  allocated on the Ada side, and the
> buffer size is not known in the C files due to a variety of very poor
> design choices.

I managed to pass the buffer length from Ada side to C code in
some cases. No idea did I do it correctly, but it seemed to work.

I've tried fixing this rats  nest before, and got lost. I don't plan
> on trying again.

Same problem here. Ada runtime (or Ada in general) in gcc
is quite complex thing and I didn't have time to continue
working on the port, so I had to give up and hope that
someone else will continue.

Yours,
 Tero

Reply via email to