From owner-svn-src-head@FreeBSD.ORG Tue Jun 18 02:07:16 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0DD5340E; Tue, 18 Jun 2013 02:07:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 953AB1F28; Tue, 18 Jun 2013 02:07:15 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D85BB1041A9A; Tue, 18 Jun 2013 12:07:13 +1000 (EST) Date: Tue, 18 Jun 2013 12:07:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov Subject: Re: svn commit: r251862 - in head: sys/dev/puc sys/dev/vxge usr.bin/csup usr.bin/sort In-Reply-To: <201306172011.r5HKB4b0024888@svn.freebsd.org> Message-ID: <20130618114258.G1695@besplex.bde.org> References: <201306172011.r5HKB4b0024888@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=z41KVO_GQT0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=KZVj2_VzFQYA:10 a=KKfuTqJ97j0AtwbGCMIA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 02:07:16 -0000 On Mon, 17 Jun 2013, Sergey Kandaurov wrote: > Log: > Clean up -Wheader-guard warnings. An interesting feature. It seems to be missing warnings about style bugs in header-guard names. > Modified: head/sys/dev/puc/puc_bfe.h > ============================================================================== > --- head/sys/dev/puc/puc_bfe.h Mon Jun 17 19:54:47 2013 (r251861) > +++ head/sys/dev/puc/puc_bfe.h Mon Jun 17 20:11:04 2013 (r251862) > @@ -27,7 +27,7 @@ > */ > > #ifndef _DEV_PUC_BFE_H_ > -#define _DEV_PUC_BFE_H > +#define _DEV_PUC_BFE_H_ Local headers shouldn't have or need header-guards, but the name and formatting of this header-guard is in normal style. > > #define PUC_PCI_BARS 6 > The name and formatting at the end of the file were already correct, but the comment on the #endif is still backwards. > Modified: head/sys/dev/puc/puc_cfg.h Similarly in other puc headers. > Modified: head/sys/dev/vxge/vxge.h > ============================================================================== > --- head/sys/dev/vxge/vxge.h Mon Jun 17 19:54:47 2013 (r251861) > +++ head/sys/dev/vxge/vxge.h Mon Jun 17 20:11:04 2013 (r251862) > @@ -31,7 +31,7 @@ > /*$FreeBSD$*/ > > #ifndef _VXGE_H_ > -#define __VXGE_H_ > +#define _VXGE_H_ This one has more style bugs: - tab instead of space after ifndef - no path prefix in header name > > #include > #include > And at the end of the file: - tab instead of space after ifndef - the comment is backwards of course. > Modified: head/usr.bin/csup/updater.h > ============================================================================== > --- head/usr.bin/csup/updater.h Mon Jun 17 19:54:47 2013 (r251861) > +++ head/usr.bin/csup/updater.h Mon Jun 17 20:11:04 2013 (r251862) > @@ -26,7 +26,7 @@ > * $FreeBSD$ > */ > #ifndef _UPDATER_H_ > -#define _UPDATER_H > +#define _UPDATER_H_ > > void *updater(void *); > Missing blank line before #define. Space instead of tab after #define. No path prefix, but application headers are much more local than dev headers, so a path prefix is less useful for them. Some dev headers are installed in /usr/include, but the puc ones aren't. The style of the #endif is normal in this file, but the ifdef section is so short that it breaks the style(9) rule about not commenting short ifdefs. This include file has 1 line of useful code, 5 lines of head-guard and 27 lines of copyright. csup has header files like this that would be tiny except for the copyright. I don't like this organization. The 1 useful line in this include file consists of a prototype, so it doesn't need a header-guard. > Modified: head/usr.bin/sort/vsort.h > ============================================================================== > --- head/usr.bin/sort/vsort.h Mon Jun 17 19:54:47 2013 (r251861) > +++ head/usr.bin/sort/vsort.h Mon Jun 17 20:11:04 2013 (r251862) > @@ -28,7 +28,7 @@ > */ > > #if !defined(__VSORT_H__) > -#define _VSORT_H__ > +#define __VSORT_H__ > > #include "bwstring.h" > #if !defined() instead of #ifdef. Excessive underscores in header-guard name (the old name was half correct). Space instead of tab after #define. No comment on the #endif, but this is another header that would be tiny without its header-guard and copyright. Bruce