public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdocs] mention caret diagnostics and Wpedantic
@ 2013-01-10 10:00 Manuel López-Ibáñez
  2013-01-11 11:14 ` Gerald Pfeifer
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel López-Ibáñez @ 2013-01-10 10:00 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Gerald Pfeifer

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

I haven't heard any complaints about the caret diagnostics being
enabled by default, so I am tempted to think it will stay like it is
for GCC 4.8. This patch documents that and also the new -Wpedantic.
OK?

Cheers,

Manuel.

[-- Attachment #2: caret.diff --]
[-- Type: application/octet-stream, Size: 2486 bytes --]

? caret.diff
Index: gcc-4.8/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.80
diff -u -r1.80 changes.html
--- gcc-4.8/changes.html	8 Jan 2013 00:20:02 -0000	1.80
+++ gcc-4.8/changes.html	10 Jan 2013 09:59:38 -0000
@@ -140,12 +140,27 @@
 <h3>C family</h3>
 
   <ul>
+
+    <li>By default, each diagnostic emitted includes the original
+    source line and a caret '^' indicating the column.
+    The option <code>-fno-diagnostics-show-caret</code>
+    suppresses this information.</li>
+    
     <li>The option <code>-ftrack-macro-expansion=2</code> is now
     enabled by default. This allows the compiler to display the
-    macro expansion stack in diagnostics.</li>
-  </ul>
+    macro expansion stack in diagnostics. Combined with the caret
+    information, an example diagnostic showing these two features
+    is:
+<blockquote><pre>
+t.c:1:94: error: invalid operands to binary < (have ‘struct mystruct’ and ‘float’)
+ #define MYMAX(A,B)    __extension__ ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
+                                                                                              ^
+t.c:7:7: note: in expansion of macro 'MYMAX'
+   X = MYMAX(P, F);
+       ^
+</pre></blockquote>
+</li>    
 
-  <ul>
     <li>A new <code>-Wsizeof-pointer-memaccess</code> warning has been added
     (also enabled by <code>-Wall</code>) to warn about suspicious length parameters
     to certain string and memory built-in functions if the argument uses
@@ -153,6 +168,17 @@
     about <code>memset (ptr, 0, sizeof (ptr));</code> if <code>ptr</code> is not an array,
     but a pointer, and suggests a possible fix, or about
     <code>memcpy (&amp;foo, ptr, sizeof (&amp;foo));</code>.</li>
+
+    <li>The new option <code>-Wpedantic</code> is an alias for
+  <code>-pedantic</code>, which is now deprecated. The forms
+  <code>-Wno-pedantic</code>, <code>-Werror=pedantic</code>, and
+  <code>-Wno-error=pedantic</code> work in the same way as for any other
+  <code>-W</code> option. One caveat is that
+  <code>-Werror=pedantic</code> is <b>not</b> equivalent to
+  <code>-pedantic-errors</code>, since the latter makes into errors
+  some warnings that are not controlled by <code>-Wpedantic</code>,
+  and the former only affects options that are disabled when using
+  <code>-Wno-pedantic</code>.
   </ul>  
 
 <!--

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

* Re: [wwwdocs] mention caret diagnostics and Wpedantic
  2013-01-10 10:00 [wwwdocs] mention caret diagnostics and Wpedantic Manuel López-Ibáñez
@ 2013-01-11 11:14 ` Gerald Pfeifer
  0 siblings, 0 replies; 2+ messages in thread
From: Gerald Pfeifer @ 2013-01-11 11:14 UTC (permalink / raw)
  To: Manuel López-Ibáñez; +Cc: gcc-patches

[-- Attachment #1: Type: TEXT/PLAIN, Size: 788 bytes --]

On Thu, 10 Jan 2013, Manuel López-Ibáñez wrote:
> I haven't heard any complaints about the caret diagnostics being
> enabled by default, so I am tempted to think it will stay like it is
> for GCC 4.8. This patch documents that and also the new -Wpedantic.
> OK?

Nice!

+    <li>By default, each diagnostic emitted includes the original

How about adding "now includes" to emphasize this is new behavior,
as opposed to a summary/introduction ahead of the next item?

+  <code>-Werror=pedantic</code> is <b>not</b> equivalent to

Can you make this <strong>not</strong> (or just <em>not</em>)?

+  <code>-Wno-pedantic</code>.

I believe you'll want to close this with </li> at the end.

Looks good to me.

Gerald

PS: Your mailer attached the patch as Application/OCTET-STREAM, not
text.

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

end of thread, other threads:[~2013-01-11 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 10:00 [wwwdocs] mention caret diagnostics and Wpedantic Manuel López-Ibáñez
2013-01-11 11:14 ` Gerald Pfeifer

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).