On 30/01/17 17:54 +0000, Jonathan Wakely wrote:
This adds the porting to guide for GCC 7. So far it only has details
of C++ changes, mostly in the std::lib.
Committed to CVS.
And this fixes the HTML errors.
Committed to CVS.
Index: htdocs/gcc-7/porting_to.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/porting_to.html,v
retrieving revision 1.1
diff -u -r1.1 porting_to.html
--- htdocs/gcc-7/porting_to.html 30 Jan 2017 17:55:20 -0000 1.1
+++ htdocs/gcc-7/porting_to.html 30 Jan 2017 17:58:37 -0000
@@ -35,9 +35,10 @@
<h3 id="conversion-op-mangling">Mangling change for conversion operators</h3>
+<p>
GCC 7 changes the name mangling for a conversion operator that returns a type
using the <code>abi_tag</code> attribute, see
-<a href=https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71712">PR 71712</a>.
+<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71712">PR 71712</a>.
This affects code that has conversions to <code>std::string</code>,
for example:
</p>
@@ -67,7 +68,7 @@
unrelated headers such as <code><memory></code>,
<code><futex></code>, <code><mutex></code>, and
<code><regex></code>.
-Correct code should <code>#include <functional></code> to define them.
+Correct code should <code>#include <functional></code> to define them.
</p>
<h3 id="cmath">Additional overloads of <code>abs</code></h3>
@@ -86,18 +87,23 @@
As a result of this change, code which overloads <code>abs</code> may no longer
compile if the custom overloads conflict with one of the additional overloads
in the standard headers. For example, this will not compile:
+</p>
+
<pre><code>#include <stdlib.h>
-float abs(float x) { return x < 0 ? -x : x; }
+float abs(float x) { return x < 0 ? -x : x; }
</code></pre>
+
+<p>
The solution is to use the standard functions, not define conflicting
overloads. For portability to previous versions of GCC and other
implementations the <code>abs(float)</code> function can be brought into
scope by including <code><cmath</code> and adding a using-declaration:
+</p>
+
<pre><code>#include <stdlib.h>
#include <cmath> // ensure std::abs(float) is declared
using std::abs;
</code></pre>
-</p>
<p>
Additionally, <a href="../gcc-6/porting_to.html#overloaded-abs">calling