------- Comment #1 from burnus at gcc dot gnu dot org  2009-02-13 10:34 -------
For completeness, the F2003 standard has in "4.4.4 Character type"

"The length is a type parameter; its value is greater than or equal to zero." 

and later

"If the character length parameter value evaluates to a negative value, the
length of character entities declared is zero."

Thus len=-1  is valid and equivalent to len=0.

The warning is OK in my opinion as I cannot see any reason why one would like
to have it negative at compile-time (init expression). (Maybe generated
code/preprocessor expressions, but even then a warning might be helpful.)
Whether the warning should be on by default or only with -W... is another
question.


-- 


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

Reply via email to