diff mbox

[wwwdocs] Document __has_attribute in /gcc-5/changes.html

Message ID alpine.LSU.2.20.1504071033320.9357@tuna.site
State New
Headers show

Commit Message

Gerald Pfeifer April 7, 2015, 8:38 a.m. UTC
Hi Jonathan,

On Wed, 11 Mar 2015, Jonathan Wakely wrote:
> Yep, revised patch attached.

reading this update, there are some changes I'd like to suggest.

Some (or all ;-) may be disagreeable; they all stem from me
trying to understand this update.

One question: where it refers to __has_attribute returning a
date in some cases, would it make sense to provide an example
or show the format?

By the way, gcc/doc/ does not seem to contain any documentation
of this macro?  Shouldn't that be described there?

Gerald

Comments

Jakub Jelinek April 7, 2015, 8:41 a.m. UTC | #1
On Tue, Apr 07, 2015 at 10:38:09AM +0200, Gerald Pfeifer wrote:
> -	The has_attribute macros will add underscores to an attribute name
> -	if necessary to resolve the name.
> +	The <code>has_attribute</code> macro will add underscores to an
> +	attribute name if necessary to resolve the name.

This change looks problematic to me, as there is no has_attribute macro,
the "has_attribute macros" phrase was meant to stand for
"<code>__has_attribute</code> and <code>__has_cpp_attribute</code> macros".
For <code> I assume we want exact spelling.

	Jakub
Jonathan Wakely April 7, 2015, 9:09 a.m. UTC | #2
On 07/04/15 10:38 +0200, Gerald Pfeifer wrote:
>One question: where it refers to __has_attribute returning a
>date in some cases, would it make sense to provide an example
>or show the format?

The referenced SD-6 document shows the values and format:
http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations

I would expect that most people using the macros are going to be
referring to that document anyway.
diff mbox

Patch

Index: gcc-5/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v
retrieving revision 1.94
diff -u -r1.94 changes.html
--- gcc-5/changes.html	6 Apr 2015 12:56:40 -0000	1.94
+++ gcc-5/changes.html	7 Apr 2015 08:33:27 -0000
@@ -253,7 +253,7 @@ 
         of the standard directive <code>#include</code>
         and the extension <code>#include_next</code> respectively.
     </li>
-    <li>A new built-in function-like macro to detect the existence of an
+    <li>A new built-in function-like macro to determine the existence of an
 	attribute, <code>__has_attribute</code>, has been added.
 	The equivalent built-in macro <code>__has_cpp_attribute</code> was
 	added to C++ to support
@@ -270,11 +270,11 @@ 
 #endif
 foo(int x);
 </pre></blockquote>
-	If an attribute exists a nonzero constant integer is returned.
+	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.
+	The <code>has_attribute</code> macro will add underscores to an
+	attribute name if necessary to resolve the name.
 	For C++11 and onwards the attribute may be scoped.
     </li>
     <li>A new set of built-in functions for arithmetics with overflow checking