It was not possible for macros to expand defines correctly when a
comment was preceeding the expansion.
This was caused by the comment_seen flag that instructs the preprocessor
to skip tokens in commnets.
This flag is now unset when a new line (\n) is encountered.
-readability-uppercase-literal-suffix,
-hicpp-function-size,
-readability-function-size,
- -cert-env33-c
+ -cert-env33-c,
+ -cppcoreguidelines-macro-to-enum
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
// only expand macros if they match toks[0] though!
// otherwise memcpy the read bytes 1:1 into the new string
while ((read = ulas_tok(&pp->tok, &praw_line, *n))) {
+ // remove comment seen if raw line
+ // starts a new line
+ // this fixes expnasion in macros containing comments
+ if (*praw_line == '\n') {
+ comment_seen = 0;
+ }
struct ulas_ppdef *def =
ulas_preprocgetdef(pp, pp->tok.buf, pp->tok.maxlen);
.def int arg_p = 2
-#macro defarg2
+#macro defarg2
+ ; test
.db $1 + 1, $2
.db $1
#endmacro
defarg2 DEFARG * arg_p, arg_p
+