[Bug middle-end/90238] Bogus warning from -Warray-bounds, triggered by zero-length character literal

sgk at troutmask dot apl.washington.edu gcc-bugzilla@gcc.gnu.org
Thu Apr 25 01:03:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90238

--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Apr 25, 2019 at 12:41:10AM +0000, townsend at astro dot wisc.edu wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90238
> 
> --- Comment #3 from Rich Townsend <townsend at astro dot wisc.edu> ---
> (In reply to kargl from comment #2)
> > -Warray-bounds is a generic GCC option, and is used in the
> > middle end for reporting warnings.  When you use this option
> > it does not recognize that a Fortran string is not an array.
> > So, it gleefully reports an array bounds option.  In other
> > words, either ignore the warning or stop using -Warray-bounds.
> 
> Thanks for the quick response, Steve. I think I can figure a workaround that
> allows us to continue using -Warray-bounds.
> 

It's certainly confusing.  gfortran.info includes
-Warray-bounds as a warning option, but there is no
description for the option.  Grepping the gfortran
source code found the error was not coming from the
Fortran frontend.  Grepping the GCC source finds
two instances of the warning string tree-vrp.c.  I
know nothing of the middle-end code and how Fortran
strings are represented.  Hopeefully, one the
middle-end developers can provide a clue to
suppressing the warning for Fortran strings.


More information about the Gcc-bugs mailing list