[patch] fix impliedness of -Wunused-parameter depending on -Wexta option ordering

Matthias Klose doko@ubuntu.com
Mon May 12 16:14:00 GMT 2014


Am 08.05.2014 23:36, schrieb Joseph S. Myers:
> On Thu, 8 May 2014, Matthias Klose wrote:
> 
>> This fixes a regression introduced with 4.8, where the option ordering 
>> of -Wextra and -Wunused-parameter emits a warning, which is not emitted 
>> with 4.7. No regressions with the trunk, the 4.9 and 4.8 branches. Ok to 
>> check in for these?
> 
> OK.

I didn't look close enough to the gfortran test results.  PR driver/61126 is a
fix for the regression introduced with the fix for the above issue.  With this
patch proposed by Manuel, gfortran.dg/wextra_1.f now passes, and no new
regressions seen on the trunk and the branches.

  Matthias


-------------- next part --------------
gcc/fortran/

	PR driver/61126
	* options.c (gfc_handle_option): Don't enable -Wunused-parameter
	with -Wextra
	* lang.opt (Wunused-parameter): New.

gcc/

	PR driver/61126
	* opts-global.c (set_default_handlers): Fix order of handlers.

Index: gcc/fortran/lang.opt
===================================================================
--- a/src/gcc/fortran/lang.opt	(revision 210277)
+++ b/src/gcc/fortran/lang.opt	(working copy)
@@ -301,6 +301,10 @@
 Fortran Warning
 Warn about unused dummy arguments.
 
+Wunused-parameter
+LangEnabledBy(Fortran,Wextra)
+; Documented in common.opt
+
 Wzerotrip
 Fortran Warning
 Warn about zero-trip DO loops
Index: gcc/fortran/options.c
===================================================================
--- a/src/gcc/fortran/options.c	(revision 210277)
+++ b/src/gcc/fortran/options.c	(working copy)
@@ -674,12 +674,7 @@
       break;
 
     case OPT_Wextra:
-      handle_generated_option (&global_options, &global_options_set,
-			       OPT_Wunused_parameter, NULL, value,
-			       gfc_option_lang_mask (), kind, loc,
-			       handlers, global_dc);
       set_Wextra (value);
-
       break;
 
     case OPT_Wfunction_elimination:
Index: gcc/opts-global.c
===================================================================
--- a/src/gcc/opts-global.c	(revision 210277)
+++ b/src/gcc/opts-global.c	(working copy)
@@ -273,10 +273,10 @@
   handlers->unknown_option_callback = unknown_option_callback;
   handlers->wrong_lang_callback = complain_wrong_lang;
   handlers->num_handlers = 3;
-  handlers->handlers[0].handler = lang_handle_option;
-  handlers->handlers[0].mask = initial_lang_mask;
-  handlers->handlers[1].handler = common_handle_option;
-  handlers->handlers[1].mask = CL_COMMON;
+  handlers->handlers[0].handler = common_handle_option;
+  handlers->handlers[0].mask = CL_COMMON;
+  handlers->handlers[1].handler = lang_handle_option;
+  handlers->handlers[1].mask = initial_lang_mask;
   handlers->handlers[2].handler = target_handle_option;
   handlers->handlers[2].mask = CL_TARGET;
 }


More information about the Gcc-patches mailing list