[comp.unix.questions] s5last No Longer Dumps Core!

pjh@mccc.edu (Peter J. Holsberg) (06/28/91)

Chalk up another for AT&T's ANSI C compiler!  I recompiled s5last with
the K&R compiler distributed with Microport SVR3 and it works perfectly!
Welllll, *almost* perfectly -- it still doesn't exclude things in the
exclude list.

Also, CI 5.0 produced a 46,452 byte executable, while uP produced a
28,830 byte one!

Thanks to those who emailed suggestions.

Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
FAX: 609-586-6944            1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     TCF 92 - ??? ??-??, 1992

gwyn@smoke.brl.mil (Doug Gwyn) (06/29/91)

In article <1991Jun28.005902.13061@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
>Chalk up another for AT&T's ANSI C compiler!  I recompiled s5last with
>the K&R compiler distributed with Microport SVR3 and it works perfectly!

It should be noted that such symptoms do not mean that the compiler had
a problem, merely that it generated code differently.

>Welllll, *almost* perfectly -- it still doesn't exclude things in the
>exclude list.

See?

pjh@mccc.edu (Pete Holsberg) (06/30/91)

In article <16578@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
=In article <1991Jun28.005902.13061@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
=>Chalk up another for AT&T's ANSI C compiler!  I recompiled s5last with
=>the K&R compiler distributed with Microport SVR3 and it works perfectly!
=
=It should be noted that such symptoms do not mean that the compiler had
=a problem, merely that it generated code differently.

Could you explain how a compiler could generate code that would cause a
bus error and a core dump, while a different compiler would generate
code from the same source file that does not?  I'm pretty ignorant about
the different codes that compilers produce.

=>Welllll, *almost* perfectly -- it still doesn't exclude things in the
=>exclude list.
=
=See?

And that's a puzzler, because one of the people I thanked for his help
compiled it with the ISC compiler and the exclude list works.  I don't
understand how legitimate C code doesn't behave under this compiler or
that unless the compilers are buggy.

Thanks,
Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
FAX: 609-586-6944            1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     TCF 92 - ??? ??-??, 1992

gwyn@smoke.brl.mil (Doug Gwyn) (06/30/91)

In article <1991Jun30.010604.8185@mccc.edu> pjh@mccc.edu (Pete Holsberg) writes:
>I don't understand how legitimate C code doesn't behave under this compiler
>or that unless the compilers are buggy.

Obviously not.

Only a perfectly portable program could be used to test compilers like this.
There are VERY few perfectly portable programs, even among those that were
intended to be.  The number of things that could go wrong are legion, but
since you asked for an example, here's just one on the thousands that I've
seen:

	int test(arg) int arg; {int ok; if(arg < 0) ok = 0; else ok = 1;}

This function works on some systems using some compilers but not others.
I leave it to you to figure out why (for both situations).  Please don't
post your guesses here!