From owner-svn-src-head@FreeBSD.ORG Fri Dec 30 16:52:23 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 158221065677; Fri, 30 Dec 2011 16:52:23 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f07:14d3:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id C88CE8FC12; Fri, 30 Dec 2011 16:52:22 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f07:14d3:1::5]) by mail.farley.org (8.14.5/8.14.5) with ESMTP id pBUGqLEX042150; Fri, 30 Dec 2011 11:52:21 -0500 (EST) (envelope-from scf@FreeBSD.org) Date: Fri, 30 Dec 2011 11:52:21 -0500 (EST) From: "Sean C. Farley" To: Matthew D Fleming In-Reply-To: Message-ID: References: <201112252015.pBPKFfZ1073959@svn.freebsd.org> User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="56599777-835880625-1325263941=:4588" X-Spam-Status: No, score=-1.5 required=4.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228878 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 30 Dec 2011 16:52:23 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --56599777-835880625-1325263941=:4588 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 29 Dec 2011, mdf@FreeBSD.org wrote: > On Thu, Dec 29, 2011 at 6:54 PM, Sean C. Farley wrote: >> On Sun, 25 Dec 2011, Ed Schouten wrote: >> >>> Author: ed >>> Date: Sun Dec 25 20:15:41 2011 >>> New Revision: 228878 >>> URL: http://svn.freebsd.org/changeset/base/228878 >>> >>> Log: >>>  Remove unneeded guard. >>> >>>  There is no reason why needs an include guard. It is already >>>  protected by __bool_true_false_are_defined. >>> >>> Modified: >>>  head/include/stdbool.h >>> >>> Modified: head/include/stdbool.h >>> >>> ============================================================================== >>> --- head/include/stdbool.h      Sun Dec 25 18:15:31 2011        (r228877) >>> +++ head/include/stdbool.h      Sun Dec 25 20:15:41 2011        (r228878) >>> @@ -26,9 +26,6 @@ >>>  * $FreeBSD$ >>>  */ >>> >>> -#ifndef _STDBOOL_H_ >>> -#define        _STDBOOL_H_ >>> - >>> #ifndef __bool_true_false_are_defined >>> #define __bool_true_false_are_defined   1 >>> >>> @@ -44,5 +41,3 @@ typedef       int     _Bool; >>> >>> #endif /* !__cplusplus */ >>> #endif /* __bool_true_false_are_defined */ >>> - >>> -#endif /* !_STDBOOL_H_ */ >> >> >> I just thought of this while reviewing the change:  should >> __bool_true_false_are_defined be set only if __cplusplus is not set? >> It should be set for C99, but I wonder if it should be set for C++. > > My quick googling didn't show anything at all about the C++ standard > and stdbool.h or __bool_true_false_are_defined. It was probably > originally set because bool, true, and false are all C++ keywords so > certain code that wanted to ifdef on them didn't also need to check > __cplusplus. I did not find anything definitive either. >> Also, is there a style requirement that the guard for a header file >> be based off of the name of the file?  I did not see anything obvious >> for this within style(9), but I am curious. > > I think it's just common use to make sure different headers use a > different include guard, so they only protect their contents, not any > other file's. The C standard only mentions the symbols bool, true, > false, and __bool_true_false_are_defined in regards to stdbool.h. Thank you. I asked since I have only really noticed filename-based guards in the tree although not all are this way (i.e., bsdxml.h uses Expat_INCLUDED). Sean -- scf@FreeBSD.org --56599777-835880625-1325263941=:4588--