This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR 78534, 83704 Large character lengths


I have finally bootstrapped gfortran with the two patches applied and the spurious warnings with -Wall are now gone (limited testing), but I see a regression for gfortran.dg/string_1.f90 due to an additional error

/opt/gcc/_clean/gcc/testsuite/gfortran.dg/string_1.f90:13:15:

   print *, len(s)
               1
Error: Result of LEN overflows its kind at (1)

No idea why this was not emitted without the patch.

> Le 12 janv. 2018 à 21:43, Joseph Myers <joseph@codesourcery.com> a écrit :
> 
> On Fri, 12 Jan 2018, Janne Blomqvist wrote:
> 
>> (I don't know why HOST_WIDE_INT_PRINT_DEC doesn't work with the
>> diagnostics machinery on darwin, but IMHO at this point it's too late
> 
> HOST_WIDE_INT_PRINT_DEC is a host-specific printf format; for example, it 
> might use %I64d on Windows host or %lld elsewhere.  The formats used in 
> diagnostic functions must *not* be host-specific or use macros anywhere in 
> them at all, because that won't work with translation.  Diagnostic 
> functions have their own host-independent formats; %wd is the correct 
> format for HOST_WIDE_INT in diagnostic functions.
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com

I have tried to use %wp, but it didn’t work:

../../work/gcc/fortran/decl.c: In function 'void gfc_set_constant_character_len(gfc_charlen_t, gfc_expr*, gfc_charlen_t)':
../../work/gcc/fortran/decl.c:1567:5: error: unknown conversion type character 'w' in format [-Werror=format=]
     "CHARACTER expression at %L is being truncated "
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     "(%wd/%wd)", &expr->where,
     ~~~~~~~~~~~
../../work/gcc/fortran/decl.c:1567:5: error: unknown conversion type character 'w' in format [-Werror=format=]
../../work/gcc/fortran/decl.c:1567:5: error: too many arguments for format [-Werror=format-extra-args]
../../work/gcc/fortran/decl.c:1575:17: error: unknown conversion type character 'w' in format [-Werror=format=]
  gfc_error_now ("The CHARACTER elements of the array constructor "
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          "at %L must have the same length (%wd/%wd)",
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../work/gcc/fortran/decl.c:1575:17: error: unknown conversion type character 'w' in format [-Werror=format=]
../../work/gcc/fortran/decl.c:1575:17: error: too many arguments for format [-Werror=format-extra-args]

Dominique



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]