aboutsummaryrefslogtreecommitdiffstats
path: root/cppawk.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-19 06:55:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-19 06:55:31 -0700
commit50ca46f1abdd6b8f5a80e1931d92967a4a6de0a1 (patch)
tree6b04f2622a8b3c5121b4538098896a55048eb121 /cppawk.1
parenteb088d2bf6c55dd98a1cc2c0b68e1dddd3e5b975 (diff)
downloadcppawk-50ca46f1abdd6b8f5a80e1931d92967a4a6de0a1.tar.gz
cppawk-50ca46f1abdd6b8f5a80e1931d92967a4a6de0a1.tar.bz2
cppawk-50ca46f1abdd6b8f5a80e1931d92967a4a6de0a1.zip
man page: mention non-recursion of macros in BUGS.
Diffstat (limited to 'cppawk.1')
-rw-r--r--cppawk.122
1 files changed, 22 insertions, 0 deletions
diff --git a/cppawk.1 b/cppawk.1
index bbf7b0c..5004943 100644
--- a/cppawk.1
+++ b/cppawk.1
@@ -303,6 +303,28 @@ and
.B --prepro
command line options.
+The C preprocessor doesn't permit macro recursion, which introduces
+limitations to the ability to compose invocations of
+.B cppawk
+macros, thus curtailing their power.
+If in the expansion of
+some macro
+.B M
+a call of macro
+.B M
+appears, that call is not expanded. This is relied upon by C programs which
+use macros to inline same-named functions, for instance, if it were
+acceptable for the argument of
+.B strlen
+to be evaluated twice, then this macro version would be permissible:
+.ft B
+ #define strlen(x) (*(x) == 0 ? 0 : strlen(x))
+.ft R
+Here, the
+.B strlen
+call in the macro expansion is relied upon not to be expanded as a macro,
+in which case runaway expansion would occur.
+
.SH AUTHOR
Kaz Kylheku <kaz@kylheku.com>