public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers
@ 2011-03-10 16:04 Jakub Jelinek
  2011-03-15  1:30 ` Gerald Pfeifer
  2011-03-15  3:56 ` Matthias Klose
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2011-03-10 16:04 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches, Benjamin Kosnik

Hi!

This mentions -Wunused-but-set-* warnings (which are C/C++/ObjC/ObjC++, so
not sure how to mention them in the language specific areas instead) and
briefly mentions removal of <cstddef> includes.  More should go probably
into gcc-4.6/porting_to.html.

--- htdocs/gcc-4.6/changes.html.jj	2011-03-10 16:32:07.000000000 +0100
+++ htdocs/gcc-4.6/changes.html	2011-03-10 16:52:07.000000000 +0100
@@ -57,6 +57,17 @@
     <code>libquadmath</code> library is automatically built on
     such targets when building the Fortran compiler.</li>
 
+    <li>New <code>-Wunused-but-set-variable</code> and
+    <code>-Wunused-but-set-parameter</code> warnings were added
+    for C, C++, Objective-C and Objective-C++.
+    These warnings diagnose variables respective parameters which
+    are only set in the code and never otherwise used.
+    Usually such variables are useless and often even the value
+    assigned to them is computed needlessly, sometimes expensively.
+    The <code>-Wunused-but-set-variable</code> warning is enabled by
+    default by <code>-Wall</code> flag and <code>-Wunused-but-set-parameter</code>
+    by <code>-Wall -W</code> flags.</li>
+
     <li><p>Support for a number of older systems and recently
     unmaintained or untested target ports of GCC has been declared
     obsolete in GCC 4.6.  Unless there is activity to revive them, the
@@ -418,6 +429,10 @@
       they can be understood by race detectors such as Helgrind, see
       <a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html#debug.races">Data
       Race Hunting</a>.</li>
+    <li>Most libstdc++ standard headers have been changed to longer include
+      <code>cstddef</code> header as an implementation detail.  Code that
+      relied on that header being included as side-effect of including other
+      standard headers will need include <code>cstddef</code> explicitly.</li>
   </ul>
 
 <h3 id="fortran">Fortran</h3>

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers
  2011-03-10 16:04 [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers Jakub Jelinek
@ 2011-03-15  1:30 ` Gerald Pfeifer
  2011-03-15  3:56 ` Matthias Klose
  1 sibling, 0 replies; 3+ messages in thread
From: Gerald Pfeifer @ 2011-03-15  1:30 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, Benjamin Kosnik

On Thu, 10 Mar 2011, Jakub Jelinek wrote:
> This mentions -Wunused-but-set-* warnings (which are C/C++/ObjC/ObjC++, so
> not sure how to mention them in the language specific areas instead) and
> briefly mentions removal of <cstddef> includes.  More should go probably
> into gcc-4.6/porting_to.html.

This is very nice, thanks Jakub!

One idea would be to add a "C language family" subsection, but I think
your current approach is fine, too.


> +    <li>Most libstdc++ standard headers have been changed to longer include

"to no longer", I assume?

> +      <code>cstddef</code> header as an implementation detail.  Code that

the ... header

> +      standard headers will need include <code>cstddef</code> explicitly.</li>

"need to include"


Gerald

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers
  2011-03-10 16:04 [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers Jakub Jelinek
  2011-03-15  1:30 ` Gerald Pfeifer
@ 2011-03-15  3:56 ` Matthias Klose
  1 sibling, 0 replies; 3+ messages in thread
From: Matthias Klose @ 2011-03-15  3:56 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Gerald Pfeifer, gcc-patches, Benjamin Kosnik

On 10.03.2011 17:04, Jakub Jelinek wrote:
> +    default by <code>-Wall</code> flag and <code>-Wunused-but-set-parameter</code>
> +    by <code>-Wall -W</code> flags.</li>

-W is documented as "old option".  Maybe use -Wextra instead?

  Matthias

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-15  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-10 16:04 [DOC PATCH] Add -Wunused-but-set-* note to gcc-4.6/changes.html and mention removal of <cstddef> in STL headers Jakub Jelinek
2011-03-15  1:30 ` Gerald Pfeifer
2011-03-15  3:56 ` Matthias Klose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).