Messages in this thread | | | Subject | Re: fork() Problem? | From | Nat Lanza <> | Date | 05 May 1999 23:33:10 -0400 |
| |
"Richard B. Johnson" <root@chaos.analogic.com> writes:
> Now, look what Lint has to say about this. The purpose of Lint > is to check rules. It has no opinion. It just checks rules.
Look, I've said it before, but perhaps you missed it:
LINT IS NOT A STANDARDS DOCUMENT. IT IS ONLY A PROGRAMMING AID.
I don't care what Lint has to say about anything; what I care about is what the standard says. The standard is what defines the language. Lint has nothing to do with it.
But, since you seem to be in favor of using tools to decide things, I decided to do a little test. We have a variety of different Unixes here at CMU SCS, and I compiled and ran a short test program on each one, using the vendor compiler. If you're right, and the behaviour under discussion is a gcc bug, then the string "Richard is right!" gets printed out. If not, "Richard is wrong!" gets printed out.
magus@evelake:~> cat freak.c #include <stdio.h>
int never_true(void) { return 0; }
int main(int argc, char **argv) { int i;
if (i = never_true()) { fprintf(stderr, "Richard is right!\n"); } else { fprintf(stderr, "Richard is wrong!\n"); }
exit(0); } magus@evelake:~> cat test #!/bin/sh uname -srv cd /usr/tmp if [ -r /bin/c89 ]; then CC=/bin/c89; elif [ -r /usr/lang/acc ]; then CC=/usr/lang/acc; else CC=cc; fi $CC -o freak /afs/cs/user/magus/freak.c ./freak magus@evelake:~> foreach-systype ~/test * alpha-dux40 OSF1 V4.0 564 Richard is wrong! * alpha-osf32 OSF1 V3.2 148 Richard is wrong! * hp700-ux90 HP-UX A.09.07 A Richard is wrong! * hp-ux102 HP-UX B.10.20 A Richard is wrong! * i386-linux2 Linux 2.0.30 #1 Wed Jun 4 15:02:33 EDT 1997 Richard is wrong! * i386-linux3 Linux 2.2.3 #2 Mon May 3 16:36:50 EDT 1999 Richard is wrong! * pmax-ul43a ULTRIX 4.3 1 Richard is wrong! * rs-aix32 AIX 2 3 Richard is wrong! * rs-aix42 AIX 2 4 Richard is wrong! * sgi-53 IRIX 5.3 11091810 Richard is wrong! * sgi-62 IRIX 6.2 03131015 Richard is wrong! * sun4-413 SunOS 4.1.3_U1 1 Richard is wrong! * sun4-55 SunOS 5.5 Generic_103093-14 Richard is wrong!
Hmm. Sure does happen on a lot of vendor compilers for a gcc bug, doesn't it?
--nat
-- nat lanza --------------------- research programmer, parallel data lab, cmu scs magus@cs.cmu.edu -------------------------------- http://www.cs.cmu.edu/~magus/ there are no whole truths; all truths are half-truths -- alfred north whitehead
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |