This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR38407 - add -W[no-]unused-dummy-argument
- From: Tobias Burnus <burnus at net-b dot de>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Daniel Franke <franke dot daniel at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Jul 2010 09:35:50 +0200
- Subject: Re: [patch, fortran] PR38407 - add -W[no-]unused-dummy-argument
- References: <201005201824.45605.franke.daniel@gmail.com> <alpine.LNX.2.00.1007101939340.5661@acrux.dbai.tuwien.ac.at>
On 07/10/2010 07:54 PM, Gerald Pfeifer wrote:
> On Thu, 20 May 2010, Daniel Franke wrote:
>
>> Attached patch seperates warnings for unused variables and unused dummy
>> arguments.
>>
>>
>> gcc/fortran/:
>> 2010-05-20 Daniel Franke <franke.daniel@gmail.com>
>>
>> PR fortran/38407
>> * lang.opt (Wunused-dummy-argument): New option.
>>
> any chance you could add a note to
> http://gcc.gnu.org/gcc-4.6/changes.html?
> documenting this? In fact, let me suggest a patch below.
>
> --- changes.html.orig 2010-07-05 19:24:52.000000000 +0200
> +++ changes.html 2010-07-10 19:54:11.000000000 +0200
> @@ -181,6 +181,11 @@
> statement.</li>
> </ul>
> </li>
> + <li>A new command-line option <code>-Wunused-dummy-argument</code> warns
> + about unused dummy arguments and is included in <code>-Wall</code>.
> + The original <code>-Wunused-parameter</code> option no longer warns
> + about unused dummy arguments (and is not part of <code>-Wall</code>
> + but only <code>-Wextra</code>).</li>
> </ul>
>
The first part of the patch is OK. The second part is not.
"-Wunused-parameter" is not touched by the patch. (The latter is about
constants, which for historic reasons are called "PARAMETER" in Fortran;
it's called "parameter" probably because one set up the parameters first
and then compiles & ran the program. By contrast, in C function
arguments are called "parameter".)
What the patch does is to separates the warnings about uninitialized
local variables and procedure arguments. Note: both -Wunused-variable
and -Wunused-dummy-argument are enabled by -Wall.
How about something like the following?
+ <li>A new command-line option <code>-Wunused-dummy-argument</code> warns
+ about unused dummy arguments and is included in <code>-Wall</code>.
+ Before <code>-Wunused-variable</code> also warned about unused dummy
+ arguments.</li>
</ul>
Tobias