Re: Ping [patch, fortran] Remove some wrong unused warnings, do not issue warnings if there are errors.

Thomas Koenig <[email protected]> Sat, 27 Jun 2026 17:25:25 +0200
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
Hi Harald,

> 
> Looks fine to me ...
> 
>> ... I will of course remove
>>
>>>      * gfortran.dg/warn_unused_but_set_error_1.s: New test.
>>
>> from the patch before it is committed (left over from testing).
> 
> ... if you do this.

Done and committed as r17-1932, thanks!

I have also applied the patch below to wwwdocs after checking
with "tidy -e -q" and looking at it with Firefox.

Author: Thomas Koenig <[email protected]>
Date:   Sat Jun 27 16:48:17 2026 +0200

     Mention new set vs. used warning options for Fortran.

             * htdocs/gcc-17/changes.html: Document the effectiveness
             of -Wunused-but-set-variables and the new options 
-Wundefined-vars,
             -Wunused-intent-out and -Wunused-read.

diff --git a/htdocs/gcc-17/changes.html b/htdocs/gcc-17/changes.html
index 6f99bb1f9..f4ec340c0 100644
--- a/htdocs/gcc-17/changes.html
+++ b/htdocs/gcc-17/changes.html
@@ -86,6 +86,27 @@ a work-in-progress.</p>
        supported.  Additionally, the <code>f_c_string</code> intrinsic
        has been reimplemented to be more efficient.
    </li>
+  <li> The
+    <a 
href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable">
+      <code>-Wunused-but-set-variables</code> </a> option is now
+    effecive for Fortran.
+  </li>
+  <li> The new option
+    <a 
href="https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html#index-Wundefined-vars">
+      <code>-Wundefined-vars</code></a> option, enabled
+    by <code>-Wall</code>, warns about variables that are used that
+    have not been defined (i.e. have no value assigned to them).
+  </li>
+  <li>
+    The new options
+    <a 
href="https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html#index-Wunused-read">
+      <code>-Wunused-read</code></a> and
+    <a 
href="https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html#index-Wunused-intent-out">
+      <code>-Wunused-intent-out</code></a>, both
+    enabled by <code>-Wextra</code>,
+    warn about variables in <code>READ</code> statements and variables 
passed to
+    <code>INTENT(OUT)</code> variables, respectively, whose values are 
never used.
+  </li>
  </ul>