From owner-svn-src-all@FreeBSD.ORG Fri Dec 30 03:44:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3DD6106566B; Fri, 30 Dec 2011 03:44:04 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5B58FC1D; Fri, 30 Dec 2011 03:44:04 +0000 (UTC) Received: by pbcc3 with SMTP id c3so11619106pbc.13 for ; Thu, 29 Dec 2011 19:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fthelDljwZ2cbwh7tB+LGbOY6weV03mgCwio2mDs450=; b=kNvGEfWGZGxInm7oBgJNo7/u2e7bw55MET4KqocA64h9isiOois5zVayiRnTYNBM3z oWkXuDjGBO7bBoYD7nhUNWl5BmERq6JnUOoxUk3mfc0UaxWdl9yur5ARQxNS5wQTRtF6 hUqlNfON6N4uMhkri0Fjw0Om6UzdSfR6q0n4g= MIME-Version: 1.0 Received: by 10.68.213.41 with SMTP id np9mr90395829pbc.71.1325216643872; Thu, 29 Dec 2011 19:44:03 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.208.167 with HTTP; Thu, 29 Dec 2011 19:44:03 -0800 (PST) In-Reply-To: References: <201112252015.pBPKFfZ1073959@svn.freebsd.org> Date: Thu, 29 Dec 2011 19:44:03 -0800 X-Google-Sender-Auth: 7OcL_af15edSqhUS_TAfp3x_ELQ Message-ID: From: mdf@FreeBSD.org To: "Sean C. Farley" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r228878 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 03:44:04 -0000 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: >> =A0Remove unneeded guard. >> >> =A0There is no reason why needs an include guard. It is alre= ady >> =A0protected by __bool_true_false_are_defined. >> >> Modified: >> =A0head/include/stdbool.h >> >> Modified: head/include/stdbool.h >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/include/stdbool.h =A0 =A0 =A0Sun Dec 25 18:15:31 2011 =A0 =A0 = =A0 =A0(r228877) >> +++ head/include/stdbool.h =A0 =A0 =A0Sun Dec 25 20:15:41 2011 =A0 =A0 = =A0 =A0(r228878) >> @@ -26,9 +26,6 @@ >> =A0* $FreeBSD$ >> =A0*/ >> >> -#ifndef _STDBOOL_H_ >> -#define =A0 =A0 =A0 =A0_STDBOOL_H_ >> - >> #ifndef __bool_true_false_are_defined >> #define __bool_true_false_are_defined =A0 1 >> >> @@ -44,5 +41,3 @@ typedef =A0 =A0 =A0 int =A0 =A0 _Bool; >> >> #endif /* !__cplusplus */ >> #endif /* __bool_true_false_are_defined */ >> - >> -#endif /* !_STDBOOL_H_ */ > > > I just thought of this while reviewing the change: =A0should > __bool_true_false_are_defined be set only if __cplusplus is not set? =A0I= t > 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. > Also, is there a style requirement that the guard for a header file be ba= sed > off of the name of the file? =A0I did not see anything obvious for this w= ithin > 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. Cheers, matthew