[flang-commits] [PATCH] D106727: [flang] Produce proper "preprocessor output" for -E option

Andrzej Warzynski via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jul 27 13:16:41 PDT 2021


awarzynski added inline comments.


================
Comment at: flang/lib/Parser/parsing.cpp:155
+        inContinuation = true;
+      } else if (fixedForm && !inDirective && column < 7 && ch != ' ' &&
+          (ch < '0' || ch > '9')) {
----------------
klausler wrote:
> awarzynski wrote:
> > Non-digit in the first 6 columns (fixed form) is an error, right? Why not assert or issue a diagnostic here? This could hide a potential bug.
> It would be an error if we were examining the original source file, yes, but this code runs later in compilation when we are reformatting the cooked character stream, from which excess spaces have been removed by prescanning.
Ah, so `ch` is assumed to be a valid character here. That wasn't clear.

A comment for this case would be appreciated (similar to e.g. ` // Wrap long lines in a portable fashion`,  perhaps `// Add whitespaces in the first 6 columns to turn this into a valid fixed-form file`?). 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106727/new/

https://reviews.llvm.org/D106727



More information about the flang-commits mailing list