Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2015 05:25:24 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Pedro Giffuni <pfg@freebsd.org>
Cc:        Bruce Evans <brde@optusnet.com.au>, Dimitry Andric <dim@freebsd.org>,  David Chisnall <theraven@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r268137 - head/sys/sys
Message-ID:  <20150622045721.W3492@besplex.bde.org>
In-Reply-To: <5587047A.2060007@FreeBSD.org>
References:  <201407020845.s628jRG5031824@svn.freebsd.org> <5BE3492F-86A0-4CE3-A27C-8DB5EB662C64@FreeBSD.org> <55842F16.5040608@FreeBSD.org> <D58BE060-870A-4D5E-AE46-D915D9CD6A0C@FreeBSD.org> <20150620023835.N2562@besplex.bde.org> <55861046.4050501@FreeBSD.org> <20150621154332.U976@besplex.bde.org> <5586CBCE.2010608@FreeBSD.org> <20150622012426.S2603@besplex.bde.org> <5586E219.2010805@FreeBSD.org> <20150622022837.D2823@besplex.bde.org> <5587047A.2060007@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 Jun 2015, Pedro Giffuni wrote:

> On 06/21/15 11:48, Bruce Evans wrote:
>> On Sun, 21 Jun 2015, Pedro Giffuni wrote:
>>> ...
>>> Well, the fact this we just do this in the tree and no one has bothered to
>>> "clean" the situation for older compilers just indicates that no one 
>>> *cares*
>>> about older compilers.
>> 
>> No, we don't do this with older compilers, except for for a couple of
>> pre-C90 cases.  We are careful to only define names in our namespace,
>> e.g., __signed but not the C90 keyword 'signed'.  This is still fragile.
>> __signed is a keyword for gcc, and it is confusing that some of our use
>> of it require it to have the gcc meaning.  __signed is in the 
>> implementation
>> namespace so we don't own it completely.  This is what is now causing 
>> problems
>> with defining __weak.
>
> We have plenty of C++-style comments and C99 initializers in the tree.

Headers cannot use these unconditionally.

FreeBSD attempts to support:
- user code written in K&R C using __P(()) to ifdef for prototypes.  __P(())
   and missing prototypes still turn up frequently.  Most recently in zfs
   code with missing prototypes.
- ISO C90, including all C90 compilers, all C90 headers and all C90 libraries
- POSIX.1-1990.
- the POSIX.2 compiler c89.  This is one of the C90 compilers.  Actually
   it is C94 or C95 (-std=iso9899:199409).  c89 is especially strict.  Most
   carefully written C90 code can be compiled by a C11 compiler with C11
   constructs in compiled but not really used parts of standard headers.
   But c89 forces the compiler/language back to an old standard.  This
   requires the visible parts of standard headers to be written carefully
   to the old standard too.

The support mostly works.  The only brokenness that I know of in it is
the stdarg thing.  I defended against breaking it by using variadic macros

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150622045721.W3492>