"field width is too small" warning

"field width is too small" warning

How do people feel about the "field width is too small" warning, as currently implemented? I find it slightly annoying that:

write(*,'(f3.1)') 1.0

triggers: "Warning... The field width is too small for the number of fractional digits"

Well, no it isn't. It would be if the argument were negative, but otherwise it's fine.
"field width MAY be too small" would be more accurate, though probably equally annoying! I can't find a "-warn" option to disable just this form of warning.

(Version 9.0 Build 20050430Z Package ID: l_fc_p_9.0.021)

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hmm. First, you get this warning only if you have asked for standards checking. I can't find a justification for this warning in the standard, though I suppose one could argue that if the value were negative, you'd have a problem. Still, this is not the type of thing that the compiler is required to detect, and it does seem a bit aggressive to me. I'll see what others here think.

Retired 12/31/2016

The opinion around here is that the warning is appropriate.

Retired 12/31/2016

OK, thanks for considering this.

Leave a Comment

Please sign in to add a comment. Not a member? Join today