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,ec31fb6eda682268 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII From: James Alan Farrell Newsgroups: comp.lang.ada Subject: Re: STORAGE_ERROR in adainit Date: Wed, 18 Aug 2004 10:00:04 -0400 Message-ID: <7on6i05k3etrq0ol5aoaffkqasnenie5ff@4ax.com> References: X-Newsreader: Forte Free Agent 2.0/32.652 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: fw.grammatech.com X-Trace: newsfeed.slurp.net 1092837670 209.4.89.67 (18 Aug 2004 09:01:10 -0500) X-Original-NNTP-Posting-Host: 209.4.89.67 Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeed.slurp.net!not-for-mail Xref: g2news1.google.com comp.lang.ada:2807 Date: 2004-08-18T10:00:04-04:00 List-Id: On Tue, 17 Aug 2004 21:37:11 GMT, Bj�rn Persson wrote: >Yes, I get the same error messages when the main program is in C: > > >file clash_test_2_ada.ads: > >package Clash_Test_2_Ada is >end Clash_Test_2_Ada; > > >file clash_test_2_c.c: > >void program_error() {} > >int main(int argc, char** argv) { > adainit(); > program_error(); > adafinal(); > return 0; >} > > >$ gcc -c clash_test_2_c.c >$ gnatmake clash_test_2_ada >gcc -c clash_test_2_ada.ads >$ gnatbind -n clash_test_2_ada.ali >$ LANG=en_US gnatlink clash_test_2_ada.ali clash_test_2_c.o >/home/bjorn/ada/gcc-3.4.0-inst/lib/gcc/i686-pc-linux-gnu/3.4.0/adalib/libgnat.a(s-stalib.o)(.data+0x78):/home/bjorn/ada/gcc-3.4.0-objdir/gcc/ada/rts/s-stalib.adb:104: >multiple definition of `program_error' >clash_test_2_c.o(.text+0x0): first defined here >/usr/bin/ld: Warning: size of symbol `program_error' changed from 5 in >clash_test_2_c.o to 24 in >/home/bjorn/ada/gcc-3.4.0-inst/lib/gcc/i686-pc-linux-gnu/3.4.0/adalib/libgnat.a(s-stalib.o) >/usr/bin/ld: Warning: type of symbol `program_error' changed from 2 to 1 >in >/home/bjorn/ada/gcc-3.4.0-inst/lib/gcc/i686-pc-linux-gnu/3.4.0/adalib/libgnat.a(s-stalib.o) >collect2: ld returned 1 exit status >gnatlink: cannot call /home/bjorn/ada/gcc-3.4.0-inst/bin/gcc > > I'll play around with this when I get a chance. >> I found the problem by creating a small test program. When I did that >> I got a linker warning pointing to program_error (indicating in fact >> that it is used as data in one place and as a function in another >> place). > >So the difference is that you get a warning but an executable is >produced, while for me, Gnatlink treats the clash as a fatal error and >refuses to produce an executable. > Perhaps you have a newer version of gnatlink? It seems to me we've upgraded a month or so ago, but perhaps that upgrade was only some libraries (we're using asis, and we may have only upgraded the asis libs instead of the compiler). Other than that I don't understand why you would have different results. Perhaps it is because my program_error C function is in a library, not in a .o file? Don't know what different that would make, though. I'll play around with the above program to see what I get. >> In the production program I am getting an unrelated linker warning, >> but I think for some reason that warning was preventing the warning >> that I needed from being displayed. > >While I don't know what that warning is about, I'd recommend that you >fix it. It may well be another fatal error. *sigh* in a perfect world... Thanks again, James Alan Farrell