This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] Fix PR 33539
On Thu, Oct 04, 2007 at 10:24:36PM +0200, Tobias Schl?ter wrote:
> Tobias Schl?ter wrote:
> >Thomas Koenig wrote:
> >>Hello world,
> >>
> >>this fixes PR 33539 by not issuing a warning for strings
> >>that have zero length. Regression-tested on i686-pc-linux-gnu.
> >>
> >>No special test case needed; I just removed dg-warning lines from
> >>the places where they occurred in the testsuite.
> >>
> >>OK? (Also OK with the approach of not warning)?
> >
> >When I thought about this bug, I decided against this approach, as I
> >thought it might suppress valid warnings.
> >
> >The problem with doing real fix is that once we resolve character
> >lengths, we don't know where they're coming from, i.e. we can't tell if
> >they're from a module or whether they belong to PARAMETERs.
> >Unfortunately, we can't add this information to the gfc_charlen
> >structures, as they may be referred to from several objects.
> >
> >If other people agree that this is the right way of solving this, I'm by
> >no means opposed to it, though.
>
> I see that other people have already agreed. Please go ahead, Thomas :-)
>
The warning (to me) seems too noisy, and an -Wzero-length-string
option seemed to be excessive. I suppose the warning could be
triggered for 0 length string with -Wsurprising. I'll also note
that the standard explicitly states that a string can have 0
length.
--
Steve