PP: Fix #1694: Handle badly formed argument substitution.
Also added a warning for no space after a macro name.
This commit is contained in:
parent
d83344fc4e
commit
9840f11f85
7 changed files with 35 additions and 7 deletions
|
|
@ -147,6 +147,10 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
|
|||
}
|
||||
|
||||
token = scanToken(ppToken);
|
||||
} else if (token != '\n' && token != EndOfInput && !ppToken->space) {
|
||||
parseContext.ppWarn(ppToken->loc, "missing space after macro name", "#define", "");
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
// record the definition of the macro
|
||||
|
|
|
|||
|
|
@ -1056,7 +1056,7 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
|||
// Handle token-pasting logic
|
||||
token = tokenPaste(token, ppToken);
|
||||
|
||||
if (token == EndOfInput) {
|
||||
if (token == EndOfInput || token == tMarkerInput::marker) {
|
||||
missingEndifCheck();
|
||||
return EndOfInput;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue