From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21242 invoked by alias); 11 Mar 2015 18:09:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21225 invoked by uid 89); 11 Mar 2015 18:09:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 11 Mar 2015 18:09:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2BI9DUJ012588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Mar 2015 14:09:13 -0400 Received: from localhost (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2BI9B6d014143; Wed, 11 Mar 2015 14:09:12 -0400 Date: Wed, 11 Mar 2015 18:09:00 -0000 From: Jonathan Wakely To: gcc-patches@gcc.gnu.org Cc: Ed Smith-Rowland <3dw4rd@verizon.net> Subject: [wwwdocs] Document __has_attribute in /gcc-5/changes.html Message-ID: <20150311180911.GB4981@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-03/txt/msg00642.txt.bz2 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 153 This is a slightly-modified version of Ed's patch from https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02357.html which I plan to commit to CVS tomorrow. --BOKacYhQ+x31HxR3 Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 1612 Index: changes.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v retrieving revision 1.88 diff -u -r1.88 changes.html --- changes.html 10 Mar 2015 17:34:36 -0000 1.88 +++ changes.html 11 Mar 2015 18:06:52 -0000 @@ -189,6 +189,29 @@ of the standard directive #include and the extension #include_next respectively. +
  • A new built-in function to detect the existence of an attribute, + __has_attribute, has been added. The equivalent built-in + function __has_cpp_attribute was added to C++ to support + + Feature-testing recommendations for C++. + The function __has_attribute is added to all C-like + languages as an extension: +
    +int
    +#ifdef __has_attribute
    +#  if __has_attribute(__noinline__)
    +  __attribute__((__noinline__))
    +#  endif
    +#endif
    +foo(int x);
    +
    + If an attribute exists a nonzero constant integer is returned. + For standardized C++ attributes a date is returned, otherwise the + constant returned is 1. + The has_attribute macros will add underscores to an attribute name + if necessary to resolve the name. + For C++11 and onwards the attribute may be scoped. +
  • A new set of built-in functions for arithmetics with overflow checking has been added: __builtin_add_overflow, __builtin_sub_overflow and __builtin_mul_overflow --BOKacYhQ+x31HxR3--