https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66605
--- Comment #15 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- Author: manu Date: Mon Jun 29 16:25:26 2015 New Revision: 225135 URL: https://gcc.gnu.org/viewcvs?rev=225135&root=gcc&view=rev Log: Wunused-parameter warnings are given from cgraph::finalize_function, which is the middle-end. This is an oddity compared to other -Wunused-* warnings. Moreover, Fortran has its own definition of -Wunused-parameter that conflicts with the middle-end definition. This patch moves the middle-end part of Wunused-parameter to the C/C++ FEs. I'm not sure if other FEs expected this warning to work. If so, they do not seem to test for it. Ada, for example, explicitly disables it. gcc/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * cgraphunit.c (cgraph_node::finalize_function): Do not call do_warn_unused_parameter. * function.c (do_warn_unused_parameter): Move from here. * function.h (do_warn_unused_parameter): Do not declare. gcc/c-family/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * c-common.c (do_warn_unused_parameter): Move here. * c-common.h (do_warn_unused_parameter): Declare. gcc/ada/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * gcc-interface/misc.c (gnat_post_options): No need to disable warn_unused_parameter anymore. gcc/cp/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * decl.c (finish_function): Call do_warn_unused_parameter. gcc/testsuite/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * gfortran.dg/wunused-parameter.f90: New test. gcc/c/ChangeLog: 2015-06-29 Manuel López-Ibáñez <m...@gcc.gnu.org> PR fortran/66605 * c-decl.c (finish_function): Call do_warn_unused_parameter. Added: trunk/gcc/testsuite/gfortran.dg/wunused-parameter.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/ada/ChangeLog trunk/gcc/ada/gcc-interface/misc.c trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/c-family/c-common.h trunk/gcc/c/ChangeLog trunk/gcc/c/c-decl.c trunk/gcc/cgraphunit.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/function.c trunk/gcc/function.h trunk/gcc/testsuite/ChangeLog