[Bug fortran/39171] New: Misleading warning for negative character length
domob at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Feb 12 18:19:00 GMT 2009
When compiling code with a zero character-length like this:
character(len=0) :: str
end
gfortran gives no error/warning. But for a negative length:
character(len=-1) :: str
end
one gets the misleading message:
character(len=-1) :: str
1
Warning: CHARACTER variable has zero length at (1)
The correct behaviour is to adjust the negative length to zero; zero itself is
fine. Dominique suggested to print this warning instead:
Warning: CHARACTER variable xxx has a negative length,
the length has been set to zero
And instead of always printing this warning, one could make it dependend on
some -W flag.
--
Summary: Misleading warning for negative character length
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: domob at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39171
More information about the Gcc-bugs
mailing list