Who's got the ANSI (was Re: Misdeclaring "main")

Gregory Kemnitz kemnitz at mitisft.Convergent.COM
Sun Jul 23 20:29:29 AEST 1989


In article <220 at tnl.UUCP| gwollman at tnl.UUCP (Garrett A. Wollman) writes:
|In article <2268 at auspex.auspex.com>, guy at auspex.auspex.com (Guy Harris) writes:
|> Nope.  It turned out the problem was that he'd written something like:
|> 
|> 	struct foobar {
|> 		...
|> 	} <<<<<<<<<<<<<NOTE: missing semicolon!
|> 
|> 	main(argc, argv)
|> 		int argc;
|> 		char *argv[];
|> 	{
|> 		...
|> 
|> The missing semicolon caused the "struct" declaration to get glued to
|> the definition of "main"...  This presumably changed the calling sequence of
|> "main" in such a way as to scramble the incoming arguments.
|> [. . .]
|
|It is, of course, obvious, that if we used ANS C-compatible function
|prototypes, this sort of problem would never get past the compiling

Most of the System V Unix world does not have acces to an ANSI C compiler!!!
It would be nice if all the world was ANSI, but it won't be for several years.
It'll take that long for purchases of new C compilers for larger machines to
be justified to management (they cost thousands of dollars), or for them to
tricle out in normal OS releases.  Due to copyleft (see thread on comp.lang.c++)
gcc cannot be used on production code.  Therefore, K & R will remain the
industry standard for the next few years.

| [good reasons to use ANSI deleted]
|
|-GAWollman
|
|-- 
|"(-::-)"    (Siamese twins)   | "This is a public-access system, so I don't 
|gwollman at tnl.UUCP             |  know what the operator's opinions are."
|             ...uunet!uvm-gen!tnl!gwollman

----------------------------------+--------------------------------------
Greg Kemnitz                      | Software without hardware is an idea.
kemnitz at Convergent.COM            | Hardware without software is a space heater.
				  |
                                  | --Unknown author



More information about the Comp.lang.c mailing list