Skip to content

Commit

Permalink
Deprecate \, in string literals in macro args
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jan 5, 2021
1 parent 14c1361 commit e469a0b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/asm/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,8 +1529,17 @@ static size_t appendStringLiteral(size_t i, bool keepLiteral)
c = '\\';
break;

case ',':
if (keepLiteral) { /* `\,` inside a macro arg string literal */
warning(WARNING_OBSOLETE,
"`\\,` is deprecated inside strings\n");
shiftChars(1);
break;
}
/* fallthrough */
default:
error("Illegal character escape '%s'\n", print(c));
shiftChars(1);
break;
}
break;
Expand Down Expand Up @@ -1908,7 +1917,6 @@ static int yylex_RAW(void)
discardComment();
c = peek(0);
/* fallthrough */

case ',': /* End of macro arg */
case '\r':
case '\n':
Expand Down

0 comments on commit e469a0b

Please sign in to comment.