[flang-commits] [PATCH] D129023: [flang] Avoid spurious warnings in pedantic mode from FORMAT items

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 1 15:19:50 PDT 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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 <https://reviews.llvm.org/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.


https://reviews.llvm.org/D129023

Files:
  flang/docs/ParserCombinators.md
  flang/lib/Parser/io-parsers.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129023.441798.patch
Type: text/x-patch
Size: 12235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220701/14a81369/attachment-0001.bin>


More information about the flang-commits mailing list