diff mbox

[wwwdocs] gcc-6/changes.html: diagnostics, Levenshtein, -Wmisleading-indentation, jit (v2)

Message ID 1452880969.12356.14.camel@surprise
State New
Headers show

Commit Message

David Malcolm Jan. 15, 2016, 6:02 p.m. UTC
On Wed, 2016-01-13 at 10:00 -0500, David Malcolm wrote:
> Ping: https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00250.html
> 
> On Wed, 2016-01-06 at 09:50 -0500, David Malcolm wrote:
> > The attached patch adds information on various things to the
> > gcc-6/changes.html page:
> > 
> > * source-range-tracking (the patch merges the description of the string
> > location work into this, and updates the colorization of the example to
> > reflect gcc-6's behavior)
> > * fix-it hints
> > * hints for misspelled member names
> > * -Wmisleading-indentation
> > * jit improvements
> > * hints for misspelled command-line options
> > 
> > OK to commit?
> > Dave

Oops; I forgot to validate it; sorry.

Here's an updated version of the above, which the W3C validator
reports as being clean (fixing various "&" and "<" and a missing
end-tag).

OK to commit?

Dave

Comments

Gerald Pfeifer Jan. 19, 2016, 5:08 p.m. UTC | #1
On Fri, 15 Jan 2016, David Malcolm wrote:
> Here's an updated version of the above, which the W3C validator
> reports as being clean (fixing various "&" and "<" and a missing
> end-tag).

Nice - and a lot of nice changes you implemented since GCC 5!

> OK to commit?

Yep.  I was going to flag "misspelled" as being misspelt, but
my dictionary tells me you can actually say both. ;-)

Gerald
Manuel López-Ibáñez Jan. 19, 2016, 7:05 p.m. UTC | #2
On 19/01/16 17:08, Gerald Pfeifer wrote:
> On Fri, 15 Jan 2016, David Malcolm wrote:
>> Here's an updated version of the above, which the W3C validator
>> reports as being clean (fixing various "&" and "<" and a missing
>> end-tag).
>
> Nice - and a lot of nice changes you implemented since GCC 5!


Am I the only one who doesn't see the colors at 
https://gcc.gnu.org/gcc-6/changes.html#c-family nor 
https://gcc.gnu.org/gcc-5/changes.html#fortran ?

Firefox 43.0.4 says "Content Security Policy: The page's settings blocked the 
loading of a resource at self ("default-src https://gcc.gnu.org http: https:")."

Cheers,

Manuel.
Mike Stump Jan. 19, 2016, 7:31 p.m. UTC | #3
On Jan 19, 2016, at 11:05 AM, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> 
> Am I the only one who doesn't see the colors at https://gcc.gnu.org/gcc-6/changes.html#c-family nor https://gcc.gnu.org/gcc-5/changes.html#fortran ?

Yes.  The darkslategrey of the headings is very close to black, but the links should be blue.

> Firefox 43.0.4 says "Content Security Policy: The page's settings blocked the loading of a resource at self ("default-src https://gcc.gnu.org http: https:").”

Just hit clear and then reload, and see if it comes back.  Don’t think it will.
Manuel López-Ibáñez Jan. 19, 2016, 7:42 p.m. UTC | #4
On 19 January 2016 at 19:31, Mike Stump <mikestump@comcast.net> wrote:
> On Jan 19, 2016, at 11:05 AM, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
>>
>> Am I the only one who doesn't see the colors at https://gcc.gnu.org/gcc-6/changes.html#c-family nor https://gcc.gnu.org/gcc-5/changes.html#fortran ?
>
> Yes.  The darkslategrey of the headings is very close to black, but the links should be blue.

Those colors are fine but the example diagnostics should also have
colors. They had when I added them some months ago.
Jakub Jelinek Jan. 19, 2016, 7:56 p.m. UTC | #5
On Tue, Jan 19, 2016 at 07:42:53PM +0000, Manuel López-Ibáñez wrote:
> On 19 January 2016 at 19:31, Mike Stump <mikestump@comcast.net> wrote:
> > On Jan 19, 2016, at 11:05 AM, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> >>
> >> Am I the only one who doesn't see the colors at https://gcc.gnu.org/gcc-6/changes.html#c-family nor https://gcc.gnu.org/gcc-5/changes.html#fortran ?
> >
> > Yes.  The darkslategrey of the headings is very close to black, but the links should be blue.
> 
> Those colors are fine but the example diagnostics should also have
> colors. They had when I added them some months ago.

Perhaps we need to use something other than <b style='color:magenta'>...</b>
and similar, the question is what.  It certainly worked well back almost 3
years ago when I've added those into gcc-4.9/changes.html.

	Jakub
Mikhail Maltsev Jan. 19, 2016, 7:57 p.m. UTC | #6
On 01/19/2016 10:05 PM, Manuel López-Ibáñez wrote:
> Am I the only one who doesn't see the colors at
> https://gcc.gnu.org/gcc-6/changes.html#c-family nor
> https://gcc.gnu.org/gcc-5/changes.html#fortran ?
> 
> Firefox 43.0.4 says "Content Security Policy: The page's settings blocked the
> loading of a resource at self ("default-src https://gcc.gnu.org http: https:")."

This problem also reproduces with Chrome Version "47.0.2526.106 unknown
(64-bit)". The error message says:

"Refused to apply inline style because it violates the following Content
Security Policy directive: "default-src 'self' http: https:". Either the
'unsafe-inline' keyword, a hash
('sha256-8f935d27GvUutRyY9yWScUMiFUk4WTdZURISiYfPOeQ='), or a nonce
('nonce-...') is required to enable inline execution. Note also that 'style-src'
was not explicitly set, so 'default-src' is used as a fallback."

I think, this can be fixed by replacing 'style="color:red"' with 'class="..."'
and adding the corresponding CSS class to the stylesheet.
diff mbox

Patch

Index: htdocs/gcc-6/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v
retrieving revision 1.46
diff -u -p -r1.46 changes.html
--- htdocs/gcc-6/changes.html	22 Dec 2015 19:23:31 -0000	1.46
+++ htdocs/gcc-6/changes.html	15 Jan 2016 17:58:36 -0000
@@ -63,13 +63,40 @@  enum {
   oldval __attribute__ ((deprecated ("too old")))
 };
 </pre></blockquote></li>
-<li>Initial support for precise diagnostic locations within strings:
+<li>Source locations for the C and C++ compilers are now tracked as ranges,
+  rather than just points, making it easier to identify the subexpression
+  of interest within a complicated expression.
+  For example:
 <blockquote><pre>
-<b>format-strings.c:3:14:</b> <b style='color:magenta'>warning:</b> field width specifier <b>'*'</b> expects a matching <b>'int'</b> argument [-Wformat=]
+<b>test.cc:</b> In function <b>'int test(int, int, foo, int, int)'</b>:
+<b>test.cc:5:16:</b> <b style='color:red'>error:</b> no match for <b>'operator*'</b> (operand types are <b>'int'</b> and <b>'foo'</b>)
+   return p + <b style='color:red'>q * r</b> * s + t;
+              <b style='color:red'>~~^~~</b>
+</pre></blockquote>
+In addition, there is now initial support for precise diagnostic locations
+within strings:
+<blockquote><pre>
+<b>format-strings.c:3:14:</b> <b style='color:magenta'>warning:</b> field width specifier <b>'*'</b> expects a matching <b>'int'</b> argument [<b style='color:magenta'>-Wformat=</b>]
    printf("%*d");
-            <b style='color:lime'>^</b>
+            <b style='color:magenta'>^</b>
 </pre></blockquote></li>
-
+    <li>Diagnostics can now contain "fix-it hints", which are displayed
+      in context underneath the relevant source code.  For example:
+      <!-- this is currently the only example in the tree; various others are pending  -->
+<blockquote><pre>
+<b>fixits.c:</b> In function <b>'bad_deref'</b>:
+<b>fixits.c:11:13:</b> <b style='color:red'>error:</b> <b>'ptr'</b> is a pointer; did you mean to use <b>'->'</b>?
+   return ptr<b style='color:red'>.</b>x;
+             <b style='color:red'>^</b>
+             <b style='color:red'>-></b>
+</pre></blockquote></li>
+    <li>The C and C++ compilers now offer suggestions for misspelled field names:
+<blockquote><pre>
+<b>spellcheck-fields.cc:52:13:</b> <b style='color:red'>error:</b> <b>'struct s'</b> has no member named <b>'colour'</b>; did you mean <b>'color'</b>?
+   return ptr-&gt;<b style='color:red'>colour</b>;
+               <b style='color:red'>^~~~~~</b>
+</pre></blockquote></li>
+    <!-- also, pending patch to add fix-it hints to the above -->
     <li>New command-line options have been added for the C and C++ compilers:
       <ul>
         <li><code>-Wshift-negative-value</code> warns about left shifting a
@@ -89,8 +116,29 @@  enum {
           depends on the optimization options used.</li>
         <li><code>-Wduplicated-cond</code> warns about duplicated conditions
 	  in an if-else-if chain.</li>
+        <li><code>-Wmisleading-indentation</code> warns about places where the
+          indentation of the code gives a misleading idea of the block
+          structure of the code to a human reader.  For example, given
+          <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-1266">CVE-2014-1266</a>:
+<blockquote><pre>
+<b>sslKeyExchange.c:</b> In function <b>'SSLVerifySignedServerKeyExchange'</b>:
+<b>sslKeyExchange.c:631:8:</b> <b style='color:magenta'>warning:</b> statement is indented as if it were guarded by... [<b style='color:magenta'>-Wmisleading-indentation</b>]
+        <b style='color:magenta'>goto</b> fail;
+        <b style='color:magenta'>^~~~</b>
+<b>sslKeyExchange.c:629:4:</b> <b style='color:cyan'>note:</b> ...this 'if' clause, but it is not
+    <b style='color:cyan'>if</b> ((err = SSLHashSHA1.update(&amp;hashCtx, &amp;signedParams)) != 0)
+    <b style='color:cyan'>^~</b>
+</pre></blockquote>
+          This warning is enabled by <code>-Wall</code>.</li>
       </ul>
     </li>
+    <li>The C and C++ compilers now emit saner error messages if
+      merge-conflict markers are present in a source file.
+<blockquote><pre>
+<b>test.c:3:1:</b> <b style='color:red'>error:</b> version control conflict marker in file
+ <b style='color:red'>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</b> HEAD
+ <b style='color:red'>^~~~~~~</b>
+</pre></blockquote></li>
   </ul>
 
 <h3 id="c">C</h3>
@@ -166,8 +214,19 @@  enum {
 
 
 <!-- .................................................................. -->
-<!-- <h2 id="jit">libgccjit</h2> -->
-
+<h2 id="jit">libgccjit</h2>
+  <ul>
+    <li>The driver code is now run in-process within libgccjit,
+      providing a small speed-up of the compilation process.</li>
+    <li>The API has gained entrypoints for
+      <ul>
+        <li><a href="https://gcc.gnu.org/onlinedocs/jit/topics/performance.html">timing how long was spent in different parts of code</a>,</li>
+        <li><a href="https://gcc.gnu.org/onlinedocs/jit/topics/functions.html#gcc_jit_block_end_with_switch">creating switch statements</a>,</li>
+        <li><a href="https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#gcc_jit_context_set_bool_allow_unreachable_blocks">allowing unreachable basic blocks in a function</a>, and</li>
+        <li><a href="https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#gcc_jit_context_add_command_line_option">adding arbitrary command-line options to a compilation</a>.</li>
+      </ul>
+    </li>
+  </ul>
 
 <!-- .................................................................. -->
 <h2 id="targets">New Targets and Target Specific Improvements</h2>
@@ -389,6 +448,12 @@  enum {
 <h2>Other significant improvements</h2>
 
   <ul>
+    <li>The <code>gcc</code> and <code>g++</code> driver programs will now
+      provide suggestions for misspelled command line options.
+<blockquote><pre>
+$ gcc -static-libfortran test.f95
+gcc: <b style='color:red'>error:</b> unrecognized command line option <b>'-static-libfortran'</b>; did you mean <b>'-static-libgfortran'</b>?
+</pre></blockquote></li>
     <li>The <code>--enable-default-pie</code> configure option enables
 	generation of PIE by default.</li>
   </ul>