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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a610664603944b3 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: A SPARC curiosity. Date: 1997/10/29 Message-ID: <3457758D.4BAD@gsfc.nasa.gov>#1/1 X-Deja-AN: 285804028 References: <345741D3.2162@pseserv3.fw.hac.com> Reply-To: Stephen.Leake@gsfc.nasa.gov Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1997-10-29T00:00:00+00:00 List-Id: W. Wesley Groleau x4923 wrote: > > I received some SPARC-specific C code with embedded asm() from > someone at Sun. It had a lot of printf. I trimmed the output down > to the subset I needed, and it still worked. I then changed it to > put the output into an Ada string, changed the while loop to > a for loop, and had the Ada do the printing. It didn't work. > > But as I was trying to figure out what seemed wrong, I discovered > it DOES work on another SPARC! > > Details: > gcc 2.7.2 and gnat 3.10 crossmounted to both machines. > Same executable (no relinking) does not work on this: > 166 -> uname -a > SunOS sparc02 5.5.1 Generic sun4d sparc SUNW,SPARCserver-1000 > but does work on this: > 169 -> uname -a > SunOS gc058 5.5.1 Generic sun4u sparc SUNW,Ultra-2 > > The error is not a crash or other disaster, merely a truncation of > the output. Optimization -O3 and -O0 are the same. Does the C code behave the same on the two machines? They seem to have slightly different versions of the OS. If GNAT is calling the C library for low-level output, a difference in the two libraries would explain things. Hmm, that assumes the libraries are dynamically linked; does SunOS on SPARC do that? -- - Stephe