[net.unix-wizards] UNIX source code errors detected by new C compiler

pag@hao.UUCP (07/14/83)

Green Hills Software, who markets a optimizing C compiler for
68000's and NSC 16032's, claims to have discovered NUMEROUS errors
in the 4.1 source code.  Their compiler barfed on a substantial portion
of the UNIX section 1 and 8 commands, and they feel the errors detected
are real even though they don't appear under the 4.1 C compiler.  For
more details, contact:

    Carl Rosenberg
    Green Hills Software
    55 N. Saint John
    Pasadena, CA 91103
    (213)-796-6543

    No electronic mail address yet.

--peter gross

jim@uw-beaver.UUCP (07/15/83)

    Green Hills Software, who markets a optimizing C compiler for
    68000's and NSC 16032's, claims to have discovered NUMEROUS errors
    in the 4.1 source code.  Their compiler barfed on a substantial
    portion of the UNIX section 1 and 8 commands, and they feel the
    errors detected are real even though they don't appear under the
    4.1 C compiler.

But was this lots of different errors, or the same error many times?  I
think the problem of code depending on ( *(NULL) == 0 ) is pretty well
known and has been in Unix since the beginning of time.  Of course this
wouldn't be caught by a compiler.  Less well known is that the current
C language doesn't allow multiple global definitions, but most
compilers allow them and much code depends on them.  I think it would
be nice if the compiler would accept multiple globals but issue an
error message so that this usage would go away, much as the '=+'
operator has gone away.

guy@rlgvax.UUCP (Guy Harris) (07/17/83)

The trouble is that multiple global definitions aren't seen by the compiler
(unless you do something strange) but by the linker.  The UNIX 5.0 (System V)
linker DOES forbid them, I believe.  (BTW, the "=+" operators and
initializations without "=" are no longer supported by the 5.0 C compiler.)
I have gotten into the habit of using "extern" in all declarations in include
files and putting the definition of the global in only one source file.

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy

crc@clyde.UUCP (07/20/83)

 UNIX 6.0 will go back to the old way of handling globals. On UNIX 5.0,
a pre-release of 6.0 CC is provided under the name Mcc.
/crc