From owner-svn-src-head@FreeBSD.ORG Sun Dec 11 21:12:09 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 62B13106566B; Sun, 11 Dec 2011 21:12:09 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id D0CF18FC0A; Sun, 11 Dec 2011 21:12:08 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id pBBLA06F089408; Sun, 11 Dec 2011 22:10:02 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4EE51CA3.9060809@FreeBSD.org> Date: Sun, 11 Dec 2011 22:12:03 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: David Chisnall References: <201112072117.pB7LHoaL055972@svn.freebsd.org> <4EE120D7.10903@FreeBSD.org> In-Reply-To: <4EE120D7.10903@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228330 - in head: include sys/sys 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: Sun, 11 Dec 2011 21:12:09 -0000 On 08.12.11 21:40, Andreas Tobler wrote: > On 07.12.11 22:17, David Chisnall wrote: >> Author: theraven >> Date: Wed Dec 7 21:17:50 2011 >> New Revision: 228330 >> URL: http://svn.freebsd.org/changeset/base/228330 >> >> Log: >> As per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is an >> identifier reserved for the implementation in C99 and earlier so there is >> no sensible reason for introducing yet another reserved identifier when we >> could just use the one C1x uses. >> >> Approved by: brooks (mentor) > >> Modified: head/sys/sys/cdefs.h >> ============================================================================== >> --- head/sys/sys/cdefs.h Wed Dec 7 21:02:35 2011 (r228329) >> +++ head/sys/sys/cdefs.h Wed Dec 7 21:17:50 2011 (r228330) >> @@ -220,13 +220,13 @@ >> >> >> #if defined(__cplusplus)&& __cplusplus>= 201103L >> -#define __noreturn [[noreturn]] >> +#define _Noreturn [[noreturn]] >> #elif defined(__STDC_VERSION__)&& __STDC_VERSION__> 201000L >> -#define __noreturn _Noreturn >> +/* Do nothing - _Noreturn is a keyword */ >> #elif defined(__GNUC__) >> -#define __noreturn __attribute__((__noreturn__)) >> +#define _Noreturn __attribute__((__noreturn__)) > > This and the previous commit broke bootstrapping gcc. > The problem is this: > /export/devel/build/gcc/head/objdir/./gcc/include-fixed/stdlib.h:96:1: > error: expected unqualified-id before '[' token > > Line in question is: _Noreturn void abort(void); > Where _Noreturn gets expanded to [[noreturn]] > > I helped myself with adding the below. Well. No clue if it is correct. > But at least I can continue building gcc trunk. As far as I understand, GCC does not support this attribute [[noreturn]] yet. But it defines both, __cplusplus and __cplusplus=201103L. On gcc-4.7 __cplusplus=201103L is the default when we build libstdc++. So I think we have to extend the check as below or we can reorder the defines that GNUC is before the __cplusplus && __cplusplus>= 201103L. I'd appreciate any comments on this. Thanks, Andreas > Index: cdefs.h > =================================================================== > --- cdefs.h (revision 228352) > +++ cdefs.h (working copy) > @@ -219,7 +219,7 @@ > #endif > > > -#if defined(__cplusplus)&& __cplusplus>= 201103L > +#if defined(__cplusplus)&& __cplusplus>= 201103L&& !defined(__GNUC__) > #define _Noreturn [[noreturn]] > #elif defined(__STDC_VERSION__)&& __STDC_VERSION__> 201000L > /* Do nothing - _Noreturn is a keyword */