From 584240986458cbedb2c9926fb383422064c009f1 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Wed, 10 Jul 2019 15:03:02 -0700 Subject: [PATCH] [flang] Document preprocessing of Fortran comments in macro actual args Original-commit: flang-compiler/f18@f491b73636fe95ede63d9f402d14e6f29250f95b Reviewed-on: https://github.com/flang-compiler/f18/pull/557 Tree-same-pre-rewrite: false --- flang/documentation/Extensions.md | 7 +++++++ flang/documentation/Preprocessing.md | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/flang/documentation/Extensions.md b/flang/documentation/Extensions.md index 5a66e10..b3265f7 100644 --- a/flang/documentation/Extensions.md +++ b/flang/documentation/Extensions.md @@ -125,3 +125,10 @@ Extensions and legacy features deliberately not supported * Using non-integer expressions for array bounds (e.g., REAL A(3.14159)) (PGI/Intel) * Mixing INTEGER types as operands to bit intrinsics (e.g., IAND); only two compilers support it, and they disagree on sign extension. + +Preprocessing behavior +====================== +* The preprocessor is always run, whatever the filename extension may be. +* We respect Fortran comments in macro actual arguments (like GNU, Intel, NAG; + unlike PGI and XLF) on the principle that macro calls should be treated + like function references. Fortran's line continuation methods also work. diff --git a/flang/documentation/Preprocessing.md b/flang/documentation/Preprocessing.md index 94e5939..6b246f3 100644 --- a/flang/documentation/Preprocessing.md +++ b/flang/documentation/Preprocessing.md @@ -1,5 +1,5 @@ Fortran Preprocessing @@ -72,6 +72,8 @@ Judgement calls, where precedents are unclear: * `#define c 1` does not allow a `c` in column 1 to be used as a label in fixed form, rather than as a comment line indicator. * IBM claims to be ISO C compliant and therefore recognizes trigraph sequences. +* Fortran comments in macro actual arguments should be respected, on + the principle that a macro call should work like a function reference. Behavior that few compilers properly support (or none), but should: ------------------------------------------------------------------- -- 2.7.4