[all-commits] [llvm/llvm-project] ac7764: [flang] Avoid spurious warnings in pedantic mode f...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Jul 6 18:54:31 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac77649951db17f1126bde08d580ec101f0759bc
      https://github.com/llvm/llvm-project/commit/ac77649951db17f1126bde08d580ec101f0759bc
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-07-06 (Wed, 06 Jul 2022)

  Changed paths:
    M flang/docs/ParserCombinators.md
    M flang/lib/Parser/io-parsers.cpp

  Log Message:
  -----------
  [flang] Avoid spurious warnings in pedantic mode from FORMAT items

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.

Differential Revision: https://reviews.llvm.org/D129023




More information about the All-commits mailing list