This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [wwwdocs] Added /gcc-7/porting_to.html


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>&lt;memory&gt;</code>,
 <code>&lt;futex&gt;</code>, <code>&lt;mutex&gt;</code>, and
 <code>&lt;regex&gt;</code>.
-Correct code should <code>#include &lt;functional&gt</code> to define them.
+Correct code should <code>#include &lt;functional&gt;</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 &lt;stdlib.h&gt;
-float abs(float x) { return x < 0 ? -x : x; }
+float abs(float x) { return x &lt; 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>&lt;cmath</code> and adding a using-declaration:
+</p>
+
 <pre><code>#include &lt;stdlib.h&gt;
 #include &lt;cmath&gt;    // ensure std::abs(float) is declared
 using std::abs;
 </code></pre>
-</p>
 
 <p>
 Additionally, <a href="../gcc-6/porting_to.html#overloaded-abs">calling

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]