public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed, wwwdocs] gcc-13: linkify some options
@ 2023-02-08 17:37 David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add SARIF and other diagnostics improvements David Malcolm
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Malcolm @ 2023-02-08 17:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

---
 htdocs/gcc-13/changes.html | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
index 9ecd115c..a48ac220 100644
--- a/htdocs/gcc-13/changes.html
+++ b/htdocs/gcc-13/changes.html
@@ -45,7 +45,8 @@ a work-in-progress.</p>
       supported, either.)</li>
     <li>Legacy debug info compression option <code>-gz=zlib-gnu</code> was removed
       and the option is ignored right now.</li>
-    <li><code>-Warray-bounds=2</code> will no longer issue warnings for out of
+    <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Warray-bounds"><code>-Warray-bounds=2</code></a>
+      will no longer issue warnings for out of
       bounds accesses to trailing struct members of one-element array type
       anymore. Instead it diagnoses accesses to trailing arrays according to
       <code>-fstrict-flex-arrays</code>. </li>
@@ -169,7 +170,7 @@ a work-in-progress.</p>
       <li>Removal of trigraphs</li>
       <li>Removal of unprototyped functions</li>
       <li><code>printf</code> and <code>scanf</code> format checking
-      with <code>-Wformat</code> for <code>%wN</code>
+      with <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat"><code>-Wformat</code></a> for <code>%wN</code>
       and <code>%wfN</code> format length modifiers</li>
       <li><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2836.pdf">N2836</a>,
 	Identifier Syntax using Unicode Standard Annex 31</li>
@@ -180,8 +181,8 @@ a work-in-progress.</p>
   with <code>-std=c2x -Wpedantic</code>.</li>
   <li>New warnings:
     <ul>
-      <li><code>-Wenum-int-mismatch</code> warns about mismatches between an
-	  enumerated type and an integer type
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wenum-int-mismatch"><code>-Wenum-int-mismatch</code></a>
+	 warns about mismatches between an enumerated type and an integer type
 	  (<a href="https://gcc.gnu.org/PR105131">PR105131</a>)</li>
     </ul>
   </li>
@@ -232,16 +233,18 @@ a work-in-progress.</p>
   </li>
   <li>New warnings:
     <ul>
-      <li><code>-Wself-move</code> warns when a value is moved to itself with
-	  <code>std::move</code>
-	  (<a href="https://gcc.gnu.org/PR81159">PR81159</a>)</li>
-      <li><code>-Wdangling-reference</code> warns when a reference is bound to
-	  a temporary whose lifetime has ended
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wself-move"><code>-Wself-move</code></a>
+	warns when a value is moved to itself with <code>std::move</code>
+	(<a href="https://gcc.gnu.org/PR81159">PR81159</a>)</li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wdangling-reference"><code>-Wdangling-reference</code></a>
+	warns when a reference is bound to a temporary whose lifetime
+	has ended
 	  (<a href="https://gcc.gnu.org/PR106393">PR106393</a>)</li>
     </ul>
   </li>
-  <li>The <code>-Wpessimizing-move</code> and <code>-Wredundant-move</code>
-      warnings have been extended to warn in more contexts.</li>
+  <li>The <a href="https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wpessimizing-move"><code>-Wpessimizing-move</code></a>
+    and <a href="https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wredundant-move"><code>-Wredundant-move</code></a>
+    warnings have been extended to warn in more contexts.</li>
 </ul>
 
 <h4 id="libstdcxx">Runtime Library (libstdc++)</h4>
@@ -463,8 +466,8 @@ a work-in-progress.</p>
      flexible array member for the purpose of accessing the elements of such
      an array. By default, all trailing arrays in aggregates are treated as
      flexible array members. Use the new command-line option
-     <code>-fstrict-flex-arrays</code> to control which array members are
-     treated as flexible arrays.
+     <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict-flex-arrays"><code>-fstrict-flex-arrays</code></a>
+     to control which array members are treated as flexible arrays.
  </li>
 </ul>
 
-- 
2.37.1


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

* [pushed, wwwdocs] gcc-13: add SARIF and other diagnostics improvements
  2023-02-08 17:37 [pushed, wwwdocs] gcc-13: linkify some options David Malcolm
@ 2023-02-08 17:37 ` David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add -Wxor-used-as-pow David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add analyzer improvements David Malcolm
  2 siblings, 0 replies; 4+ messages in thread
From: David Malcolm @ 2023-02-08 17:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

---
 htdocs/gcc-13/changes.html | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
index a48ac220..8c0201f2 100644
--- a/htdocs/gcc-13/changes.html
+++ b/htdocs/gcc-13/changes.html
@@ -128,6 +128,23 @@ a work-in-progress.</p>
       will no longer add startup code to alter the floating-point environment
       when producing a shared object with <code>-shared</code>.
   </li>
+  <li>
+    GCC can now emit its diagnostics using <a href="https://sarifweb.azurewebsites.net/">SARIF</a>.
+    This is a JSON-based format suited for capturing the results of static
+    analysis tools (like GCC's <a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html"><code>-fanalyzer</code></a>),
+    but it can also be used to capture other GCC warnings and errors in a
+    machine-readable format.
+    Specifically, the <a href="https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format"><code>-fdiagnostics-format=</code></a>
+    option has been extended to support these new values:
+    <ul>
+      <li><code>-fdiagnostics-format=sarif-stderr</code></li>
+      <li><code>-fdiagnostics-format=sarif-file</code></li>
+      <li><code>-fdiagnostics-format=json-stderr</code>, a synonym for the
+	existing <code>-fdiagnostics-format=json</code></li>
+      <li><code>-fdiagnostics-format=json-file</code></li>
+    </ul>
+    where the <code>json</code>-prefixed variants refer to GCC's own JSON diagnostic format.
+  </li>
 </ul>
 
 
@@ -453,7 +470,18 @@ a work-in-progress.</p>
 <!-- <h2>Documentation improvements</h2> -->
 
 <!-- .................................................................. -->
-<!-- <h2 id="plugins">Improvements for plugin authors</h2> -->
+<h2 id="plugins">Improvements for plugin authors</h2>
+
+<ul>
+  <li>GCC diagnostics can now be
+    <a href="https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0b14f590e3e9d95b8211b77d992589d5ab4c25f0">associated with rules</a>
+    such as from coding standards documents, or specifications.
+    Such rules have a code name and can have a URL, which GCC can print
+    in text form or capture in its
+    <a href="https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format">SARIF</a>
+    output when emitting diagnostics.
+  </li>
+</ul>
 
 <!-- .................................................................. -->
 <h2>Other significant improvements</h2>
-- 
2.37.1


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

* [pushed, wwwdocs] gcc-13: add -Wxor-used-as-pow
  2023-02-08 17:37 [pushed, wwwdocs] gcc-13: linkify some options David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add SARIF and other diagnostics improvements David Malcolm
@ 2023-02-08 17:37 ` David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add analyzer improvements David Malcolm
  2 siblings, 0 replies; 4+ messages in thread
From: David Malcolm @ 2023-02-08 17:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

---
 htdocs/gcc-13/changes.html | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
index 8c0201f2..d70ac1de 100644
--- a/htdocs/gcc-13/changes.html
+++ b/htdocs/gcc-13/changes.html
@@ -153,7 +153,17 @@ a work-in-progress.</p>
 
 <!-- <h3 id="ada">Ada</h3> -->
 
-<!-- <h3 id="c-family">C family</h3> -->
+<h3 id="c-family">C family</h3>
+<ul>
+  <li>New warnings:
+    <ul>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wxor-used-as-pow"><code>-Wxor-used-as-pow</code></a>
+	warns about uses of <code>^</code>, the exclusive or operator,
+	where it appears the user meant exponentiation
+	(<a href="https://gcc.gnu.org/PR90885">PR90885</a>)</li>
+    </ul>
+  </li>
+</ul>
 
 <h3 id="c">C</h3>
 <ul>
-- 
2.37.1


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

* [pushed, wwwdocs] gcc-13: add analyzer improvements
  2023-02-08 17:37 [pushed, wwwdocs] gcc-13: linkify some options David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add SARIF and other diagnostics improvements David Malcolm
  2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add -Wxor-used-as-pow David Malcolm
@ 2023-02-08 17:37 ` David Malcolm
  2 siblings, 0 replies; 4+ messages in thread
From: David Malcolm @ 2023-02-08 17:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

---
 htdocs/gcc-13/changes.html | 58 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
index d70ac1de..5dbcc229 100644
--- a/htdocs/gcc-13/changes.html
+++ b/htdocs/gcc-13/changes.html
@@ -50,6 +50,9 @@ a work-in-progress.</p>
       bounds accesses to trailing struct members of one-element array type
       anymore. Instead it diagnoses accesses to trailing arrays according to
       <code>-fstrict-flex-arrays</code>. </li>
+    <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html"><code>-fanalyzer</code></a>
+      is still only suitable for analyzing C code.
+      In particular, using it on C++ is unlikely to give meaningful output.
 </ul>
 
 
@@ -163,6 +166,16 @@ a work-in-progress.</p>
 	(<a href="https://gcc.gnu.org/PR90885">PR90885</a>)</li>
     </ul>
   </li>
+  <li>Three new function attributes for documenting <code>int</code> arguments that are file descriptors:
+    <ul>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-fd_005farg-function-attribute"><code>__attribute__((fd_arg(N)))</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-fd_005farg_005fread-function-attribute"><code>__attribute__((fd_arg_read(N)))</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-fd_005farg_005fwrite-function-attribute"><code>__attribute__((fd_arg_write(N)))</code></a></li>
+    </ul>
+    These are used by
+    <a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html"><code>-fanalyzer</code></a>
+    to detect misuses of file descriptors.
+  </li>
 </ul>
 
 <h3 id="c">C</h3>
@@ -479,6 +492,51 @@ a work-in-progress.</p>
 <!-- .................................................................. -->
 <!-- <h2>Documentation improvements</h2> -->
 
+<h2 id="analyzer">Improvements to Static Analyzer</h2>
+<ul>
+  <li>The analyzer has gained 20 new warnings:
+    <ul>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-allocation-size"><code>-Wanalyzer-allocation-size</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-deref-before-check"><code>-Wanalyzer-deref-before-check</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-exposure-through-uninit-copy"><code>-Wanalyzer-exposure-through-uninit-copy</code></a></li>
+      <li>Seven new warnings relating to misuse of file descriptors:
+	<ul>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-access-mode-mismatch"><code>-Wanalyzer-fd-access-mode-mismatch</code></a></li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-double-close"><code>-Wanalyzer-fd-double-close</code></a></li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-leak"><code>-Wanalyzer-fd-leak</code></a></li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-phase-mismatch"><code>-Wanalyzer-fd-phase-mismatch</code></a>
+	    (e.g. calling <code>accept</code> on a socket before calling
+	    <code>listen</code> on it)</li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-type-mismatch"><code>-Wanalyzer-fd-type-mismatch</code></a>
+	    (e.g. using a stream socket operation on a datagram socket)</li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-use-after-close"><code>-Wanalyzer-fd-use-after-close</code></a></li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-use-without-check"><code>-Wanalyzer-fd-use-without-check</code></a></li>
+	</ul>
+	<p>along with special-casing handling of the behavior of
+	  <code>open</code>, <code>close</code>, <code>creat</code>,
+	  <code>dup</code>, <code>dup2</code>, <code>dup3</code>,
+	  <code>pipe</code>, <code>pipe2</code>, <code>read</code>,
+	  and <code>write</code>.</p>
+      </li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-imprecise-fp-arithmetic"><code>-Wanalyzer-imprecise-fp-arithmetic</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-infinite-recursion"><code>-Wanalyzer-infinite-recursion</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-jump-through-null"><code>-Wanalyzer-jump-through-null</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-out-of-bounds"><code>-Wanalyzer-out-of-bounds</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-putenv-of-auto-var"><code>-Wanalyzer-putenv-of-auto-var</code></a></li>
+      <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-assertion"><code>-Wanalyzer-tainted-assertion</code></a></li>
+      <li>Four new warnings for misuses of <code>&lt;stdarg.h&gt;</code>:
+	<ul>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-va-list-leak"><code>-Wanalyzer-va-list-leak</code></a> for complaining about missing <code>va_end</code> after a <code>va_start</code> or <code>va_copy</code></li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-va-list-use-after-va-end"><code>-Wanalyzer-va-list-use-after-va-end</code></a> for complaining about <code>va_arg</code> or <code>va_copy</code> used on a <code>va_list</code> that's had <code>va_end</code> called on it</li>
+          <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-va-arg-type-mismatch"><code>-Wanalyzer-va-arg-type-mismatch</code></a> for type-checking of <code>va_arg</code> usage in interprocedural execution paths against the types of the parameters that were actually passed to the variadic call</li>
+	  <li><a href="https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html#index-Wanalyzer-va-list-exhausted"><code>-Wanalyzer-va-list-exhausted</code></a> for complaining in interprocedural execution paths if <code>va_arg</code> is used too many times on a <code>va_list</code></li>
+	</ul>
+      </li>
+    </ul>
+    along with numerous other improvements.
+  </li>
+</ul>
+
 <!-- .................................................................. -->
 <h2 id="plugins">Improvements for plugin authors</h2>
 
-- 
2.37.1


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

end of thread, other threads:[~2023-02-08 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 17:37 [pushed, wwwdocs] gcc-13: linkify some options David Malcolm
2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add SARIF and other diagnostics improvements David Malcolm
2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add -Wxor-used-as-pow David Malcolm
2023-02-08 17:37 ` [pushed, wwwdocs] gcc-13: add analyzer improvements David Malcolm

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