re PR fortran/33141 (Intrinsic procedures: Improve warning/error with -std=*)
authorDaniel Kraft <d@domob.eu>
Thu, 24 Jul 2008 18:52:51 +0000 (20:52 +0200)
committerDaniel Kraft <domob@gcc.gnu.org>
Thu, 24 Jul 2008 18:52:51 +0000 (20:52 +0200)
commitc3005b0f0c8081ccb719740c3c27ee13d5697add
tree85be9ebc4a554eb2712749c7968b5f149a50d8eb
parentbefdf74172fe5f6d61f708e152f2e54540b75f21
re PR fortran/33141 (Intrinsic procedures: Improve warning/error with -std=*)

2008-07-24  Daniel Kraft  <d@domob.eu>

PR fortran/33141
* lang.opt (Wnonstd-intrinsics):  Removed option.
(Wintrinsics-std), (Wintrinsic-shadow):  New options.
* invoke.texi (Option Summary):  Removed -Wnonstd-intrinsics
from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
(Error and Warning Options):  Documented the new options and removed
the documentation for -Wnonstd-intrinsics.
* gfortran.h (gfc_option_t):  New members warn_intrinsic_shadow and
warn_intrinsics_std, removed warn_nonstd_intrinsics.
(gfc_is_intrinsic):  Renamed from gfc_intrinsic_name.
(gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard):  New.
* decl.c (match_procedure_decl):  Replaced gfc_intrinsic_name by
the new name gfc_is_intrinsic.
(warn_intrinsic_shadow):  New helper method.
(gfc_match_function_decl), (gfc_match_subroutine):  Call the new method
warn_intrinsic_shadow to check the just-parsed procedure.
* expr.c (check_init_expr):  Call new gfc_is_intrinsic to check whether
the function called is really an intrinsic in the selected standard.
* intrinsic.c (gfc_is_intrinsic):  Renamed from gfc_intrinsic_name and
extended to take into account the selected standard settings when trying
to find out whether a symbol is an intrinsic or not.
(gfc_check_intrinsic_standard):  Made public and extended.
(gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface):  Removed
the calls to check_intrinsic_standard, this check now happens inside
gfc_is_intrinsic.
(gfc_warn_intrinsic_shadow):  New method defined.
* options.c (gfc_init_options):  Initialize new warning flags to false
and removed intialization of Wnonstd-intrinsics flag.
(gfc_post_options):  Removed logic for Wnonstd-intrinsics flag.
(set_Wall):  Set new warning flags and removed Wnonstd-intrinsics flag.
(gfc_handle_option):  Handle the new flags and removed handling of the
old Wnonstd-intrinsics flag.
* primary.c (gfc_match_rvalue):  Replaced call to gfc_intrinsic_name by
the new name gfc_is_intrinsic.
* resolve.c (resolve_actual_arglist):  Ditto.
(resolve_generic_f), (resolve_unknown_f):  Ditto.
(is_external_proc):  Ditto.
(resolve_generic_s), (resolve_unknown_s):  Ditto.
(resolve_symbol):  Ditto and ensure for symbols declared INTRINSIC that
they are really available in the selected standard setting.

2008-07-24  Daniel Kraft  <d@domob.eu>

PR fortran/33141
* gfortran.dg/intrinsic_shadow_1.f03:  New test for -Wintrinsic-shadow.
* gfortran.dg/intrinsic_shadow_2.f03:  Ditto.
* gfortran.dg/intrinsic_shadow_3.f03:  Ditto.
* gfortran.dg/intrinsic_std_1.f90:  New test for -Wintrinsics-std.
* gfortran.dg/intrinsic_std_2.f90:  Ditto.
* gfortran.dg/intrinsic_std_3.f90:  Ditto.
* gfortran.dg/intrinsic_std_4.f90:  Ditto.
* gfortran.dg/warn_std_1.f90:  Removed option -Wnonstd-intrinsics.
* gfortran.dg/warn_std_2.f90:  Replaced -Wnonstd-intrinsics by
-Wintrinsics-std and adapted expected errors/warnings.
* gfortran.dg/warn_std_3.f90:  Ditto.
* gfortran.dg/c_sizeof_2.f90:  Adapted expected error/warning message.
* gfortran.dg/gamma_2.f90:  Ditto.
* gfortran.dg/selected_char_kind_3.f90:  Ditto.
* gfortran.dg/fmt_g0_2.f08:  Call with -fall-intrinsics to allow abort.

From-SVN: r138122
25 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/expr.c
gcc/fortran/gfortran.h
gcc/fortran/intrinsic.c
gcc/fortran/invoke.texi
gcc/fortran/lang.opt
gcc/fortran/options.c
gcc/fortran/primary.c
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/c_sizeof_2.f90
gcc/testsuite/gfortran.dg/fmt_g0_2.f08
gcc/testsuite/gfortran.dg/gamma_2.f90
gcc/testsuite/gfortran.dg/intrinsic_shadow_1.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_shadow_2.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_shadow_3.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_std_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_std_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/intrinsic_std_4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
gcc/testsuite/gfortran.dg/warn_std_1.f90
gcc/testsuite/gfortran.dg/warn_std_2.f90
gcc/testsuite/gfortran.dg/warn_std_3.f90