From: Tobias Burnus Date: Mon, 8 Jul 2013 12:15:11 +0000 (+0200) Subject: re PR fortran/57469 (Erroneous warning for unused dummy arguments used in namelist) X-Git-Tag: upstream/12.2.0~68895 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8877f40377038ad919467e472ca09625559b1c7;p=platform%2Fupstream%2Fgcc.git re PR fortran/57469 (Erroneous warning for unused dummy arguments used in namelist) 2013-07-08 Tobias Burnus PR fortran/57469 * trans-decl.c (generate_local_decl): Don't warn that a dummy is unused, when it is in a namelist. 2013-07-08 Tobias Burnus PR fortran/57469 * gfortran.dg/warn_unused_dummy_argument_4.f90: New. From-SVN: r200785 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f85e2eb..487d929 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-07-08 Tobias Burnus + + PR fortran/57469 + * trans-decl.c (generate_local_decl): Don't warn that + a dummy is unused, when it is in a namelist. + 2013-07-01 Dominique d'Humieres PR fortran/54788 @@ -628,7 +634,7 @@ * class.c (finalization_scalarizer, finalizer_insert_packed_call, generate_finalization_wrapper): Avoid segfault with absent SIZE= - argment to TRANSFER and use correct result kind for SIZE. + argument to TRANSFER and use correct result kind for SIZE. * intrinsic.c (gfc_isym_id_by_intmod): Also handle ids of nonmodules. * trans.c (gfc_build_final_call): Handle coarrays. diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index fc3a725..6a8d98c 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4726,7 +4726,7 @@ generate_local_decl (gfc_symbol * sym) gfc_get_symbol_decl (sym); /* Warnings for unused dummy arguments. */ - else if (sym->attr.dummy) + else if (sym->attr.dummy && !sym->attr.in_namelist) { /* INTENT(out) dummy arguments are likely meant to be set. */ if (gfc_option.warn_unused_dummy_argument diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 32c5795..55b54ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-07-08 Tobias Burnus + + PR fortran/57469 + * gfortran.dg/warn_unused_dummy_argument_4.f90: New. + 2013-07-08 Manfred Schwarb * gfortran.dg/defined_assignment_7.f90: Fix dg-do. diff --git a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_4.f90 b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_4.f90 new file mode 100644 index 0000000..79e5fa1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_4.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-Wall" } +! +! PR fortran/57469 +! +! Contributed by Vladimir Fuka +! +! Don't warn for unused dummy arguments when they are used in namelists +! + subroutine read_command_line(line,a,b) + character(*),intent(in) :: line + intent(inout) :: a,b + namelist /cmd/ a,b + + read(line,nml = cmd) + end