*BSD News Article 1674


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.unix.bsd
Subject: Re: gcc 2.2.2 or 386BSD bug?
Message-ID: <1992Jun25.032817.28985@klaava.Helsinki.FI>
Date: 25 Jun 92 03:28:17 GMT
References: <1992Jun23.232355.1382@gateway.novell.com> <1992Jun24.053953.5550@serval.net.wsu.edu> <1992Jun24.210332.7464@kithrup.COM>
Organization: University of Helsinki
Lines: 22

In article <1992Jun24.210332.7464@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes:
>In article <1992Jun24.053953.5550@serval.net.wsu.edu> hlu@phys1.physics.wsu.edu (Hongjiu Lu) writes:
>>>I don't know of any UNIX (or any
>>>other OS, for that matter) written in entirely conforming ANSI C.
>>Take a look at Linux.
>
>Last time I looked at it, Linux used inline assembly statements.  It is not,
>therefore, a conforming application.

Indeed.  Linux also does a lot of compiler assumptions (unsigned long is
casted to pointers and vice versa), but that's not surprising for any OS
that has to do hardware-level programming (the MMU needs pointer<->int
conversions for bit-twiddling the pointers).  I have tried to make it as
clean as possible though: I compile linux with -Wall and optimizations,
and the warnings reported aren't very many. 

In fact linux can be compiled only with gcc that uses the gas syntax,
and due to problems with earlier versions of gcc, it had better be 2.1
or newer.  So no, it's not conforming, but most of it comes pretty
close. 

		Linus