[Bug fortran/36534] New: Bogus: '__convert_s1_s4' at (1) is obsolescent in fortran 95

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jun 13 21:34:00 GMT 2008


Found via a typo and missing -pedantic in
gfortran.dg/parameter_array_init_4.f90

$ gfortran -pedantic gfortran.dg/parameter_array_init_4.f90
parameter_array_init_4.f90:18.45:

PARAMETER ( MY_STRING4 = (/ "A" , "B", "C" /) )
                                            1
Warning: CHARACTER(*) function '__convert_s1_s4' at (1) is obsolescent in
fortran 95

Expected: No warning message for internal functions.


See resolve.c:

  if (sym->attr.function
      && sym->ts.type == BT_CHARACTER
      && sym->ts.cl && sym->ts.cl->length == NULL)
    {
[...]
      /* Appendix B.2 of the standard.  Contained functions give an
         error anyway.  Fixed-form is likely to be F77/legacy.  */
      if (!sym->attr.contained && gfc_current_form != FORM_FIXED)
        gfc_notify_std (GFC_STD_F95_OBS, "CHARACTER(*) function "
                        "'%s' at %L is obsolescent in fortran 95",
                        sym->name, &sym->declared_at);

Test case:

CHARACTER (kind=4,len=*) MY_STRING4(1:3), my_string_s4
PARAMETER ( MY_STRING4 = (/ "A" , "B", "C" /) )


-- 
           Summary: Bogus: '__convert_s1_s4' at (1) is obsolescent in
                    fortran 95
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36534



More information about the Gcc-bugs mailing list