This is an archive of the discontinued LLVM Phabricator instance.

[flang] Avoid spurious warnings in pedantic mode from FORMAT items
ClosedPublic

Authored by klausler on Jul 1 2022, 3:19 PM.

Details

Summary

In free form source, pedantic mode will elicit portability warnings
about missing spaces when a token string ends with a character that
can be in an identifier and there is no space between that last token
character and a following character that can also be part of an identifier.

This behavior doesn't really work well for the token strings that are
parsed for edit descriptors in FORMAT statements. For example, the
'F' in FORMAT(F7.3) is followed by a digit, but obviously no space is
necessary. Free form or not, FORMATs are their own odd little world.

This patch adds trailing blanks to these FORMAT edit descriptor token
parsers to disable the missing space check, and extends the documentation
for token string parsing to explain why this technique works.

Diff Detail

Event Timeline

klausler created this revision.Jul 1 2022, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2022, 3:19 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Jul 1 2022, 3:19 PM
vdonaldson accepted this revision.Jul 1 2022, 4:50 PM
This revision is now accepted and ready to land.Jul 1 2022, 4:50 PM