Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2011 17:58:15 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Stefan Farfeleder <stefanf@freebsd.org>
Cc:        Tai-hwa Liang <avatar@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r223138 - head/sys/ufs/ffs
Message-ID:  <20110616175314.R935@besplex.bde.org>
In-Reply-To: <20110616065310.GA2542@mole.fafoe.narf.at>
References:  <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Jun 2011, Stefan Farfeleder wrote:

>> Log:
>>   Fixing compilation bustage by introducing another forward declaration.
>>
>> Modified:
>>   head/sys/ufs/ffs/ffs_extern.h
>>
>> Modified: head/sys/ufs/ffs/ffs_extern.h
>> ==============================================================================
>> --- head/sys/ufs/ffs/ffs_extern.h	Thu Jun 16 02:27:05 2011	(r223137)
>> +++ head/sys/ufs/ffs/ffs_extern.h	Thu Jun 16 05:26:03 2011	(r223138)
>> @@ -33,6 +33,7 @@
>>  #ifndef _UFS_FFS_EXTERN_H
>>  #define	_UFS_FFS_EXTERN_H
>>
>> +enum vtype;
>>  struct buf;
>>  struct cg;
>>  struct fid;

This might unsort the declarations (it isn't clear if the declarations
should be sorted on tag name or keyword name).

> This is not valid C code. For some reason GCC allows it (with our
> compilation flags).

This is a bug in gcc-4.2.1.  gcc-3.3.3 generates a warning for it even
with no compilation flags, while gcc-4.2.1 doesn't generate a warning
even with -Wall -std-c99.  It takes -pedantic to generate the warning
with gcc-4.2.1.  TenDRA of course generates an error.

It might be a style bug (like typedefing a struct) to use enums for
anything.  They are impossible to declare opaquely.

Bruce



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