svn commit: r223138 - head/sys/ufs/ffs

Bruce Evans brde at optusnet.com.au
Thu Jun 16 07:58:20 UTC 2011


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


More information about the svn-src-all mailing list