diff mbox

[wwwdocs] Add "Porting to GCC 4.9" document

Message ID 20140307194517.GA29739@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely March 7, 2014, 7:45 p.m. UTC
On 07/03/14 18:08 +0000, Jonathan Wakely wrote:
>On 04/03/14 22:32 +0000, Jonathan Wakely wrote:
>>I've added an initial "Porting to GCC 4.9" page at
>>http://gcc.gnu.org/gcc-4.9/porting_to.html
>>
>>So far it only contains a couple of C++ changes that caused some
>>failures during mass rebuilds, other additions are welcome.
>
>The attached patch adds some more changes (thanks to Jakub for the
>OpenMP one) and links to the porting guide form gcc-4.9/changes.html

This patch adds a note about a new warning (thanks to Marek), which
caused some build failures in binutils and gdb.
? .porting_to.html.swp
diff mbox

Patch

Index: porting_to.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.9/porting_to.html,v
retrieving revision 1.3
diff -u -r1.3 porting_to.html
--- porting_to.html	7 Mar 2014 19:19:51 -0000	1.3
+++ porting_to.html	7 Mar 2014 19:42:36 -0000
@@ -60,9 +60,32 @@ 
 <code>#pragma omp end declare target</code> directive, this is now a parsing
 error.</p>
 
-<!--
 <h2>C language issues</h2>
--->
+
+<h3>Right operand of comma operator without effect</h3>
+
+<p>GCC now warns about unused right-hand side of a comma expression that
+contains no side effects:</p>
+
+<pre><code>
+  int i = 42; 
+  bar (), i;
+</code></pre>
+
+<p>This example now gives the following diagnostic:</p>
+
+<pre>
+<b>w.c:5:9:</b> <b style='color:magenta'>warning:</b> right-hand operand of comma expression has no effect [-Wunused-value]
+   bar (), i;
+         <b style='color:lime'>^</b>
+</pre>
+
+<p>To suppress this warning cast the right-hand operand to <code>void</code>:</p>
+
+<pre><code>
+  int i = 42; 
+  bar (), (void) i;
+</code></pre>
 
 <h2>C++ language issues</h2>