[wwwdocs] Document __has_attribute in /gcc-5/changes.html
Gerald Pfeifer
gerald@pfeifer.com
Thu Apr 9 23:28:00 GMT 2015
On Tue, 7 Apr 2015, Jakub Jelinek wrote:
> 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.
Yes, that's a very good point.
On Tue, 7 Apr 2015, Jonathan Wakely wrote:
> 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.
This is a fair point as well.
Thanks for your feedback, Jakub and Jonathan. This is what I
just committed.
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v
retrieving revision 1.99
diff -u -r1.99 changes.html
--- changes.html 9 Apr 2015 15:05:01 -0000 1.99
+++ changes.html 9 Apr 2015 23:26:37 -0000
@@ -262,7 +262,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
@@ -279,11 +279,12 @@
#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.
+ Both <code>__has_attribute</code> and
+ <code>__has_cpp_attribute</code> 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
More information about the Gcc-patches
mailing list