Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!sunybcs!bingvaxu!leah!uwmcsd1!calyx!usenet From: usenet@calyx.UUCP (USENET admin) Newsgroups: comp.lang.c Subject: IBM RT compiler weirdness Message-ID: <261@calyx.UUCP> Date: Fri, 28-Aug-87 16:02:12 EDT Article-I.D.: calyx.261 Posted: Fri Aug 28 16:02:12 1987 Date-Received: Sun, 30-Aug-87 06:50:13 EDT Reply-To: ariel@calyx.UUCP (Ariel Glenn) Organization: Calyx Corporation, Milwaukee, WI Lines: 41 Keywords:missing semicolons, lint, silent! I recently ran into a problem with an IBM RT running AIX. I had a program like the following: ___ #include struct junk { int a; int b; } main(argc,argv) int argc; char **argv; { int i; for (i=0; i\n",i,argv[i]); } exit(0); } ___ It compiled fine. Lint said nothing. But the output was garbage: it seems that the missing semi-colon after the struct definition caused argc to be given the value of argv, and argv got the value of the environment varible pointer. Now the kicker is that this doesn't occur *anywhere else* (NCR Tower XP running some SYSV-ish release, uVax II under Ultrix V1.2A, various Xenix systems we have lying around). The program runs beautifully, even though it shouldn't. Lint doesn't complain on these other systems, either. It wouldn't be so bad, but in a program of a few thousand lines, where the original problem turned up, it's a real nuisance! Has anyone else had similar experiences with the RT? Is this just IBM's bizarrity? Better yet, is there some way to make lint tell me about this? _____ Ariel Glenn {ihnp4,rutgers}!uwvax!uwmcsd1!calyx!ariel (uucp) calyx!ariel@csd1.milw.wisc.edu (Internet)