Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ppci-cc: error when one argument of ## is empty #99

Open
tstreiff opened this issue Jun 25, 2020 · 0 comments
Open

ppci-cc: error when one argument of ## is empty #99

tstreiff opened this issue Jun 25, 2020 · 0 comments
Labels
C frontend Issues related to the C language compiler

Comments

@tstreiff
Copy link
Contributor

I suspect this one is derived from closed #52

#define M(a, b) . a ## b ;

// should expand in '. name ;'
M(, name)
2:#define M(a, b) . a ## b ;
^ Invalidly glued ".name"

// should expand in '. name ;'
M(name,)
6:// should expand as '. name ;'
^ Invalidly glued "name;"

In both cases, the preprocessor does not mark that there is an empty token in the token sequence.
When processing ##, it wrongly takes the nearest token (on the left in the 1st case, on the right in the 2nd case) and this raises an error because the token concatenation produces an invalid new token.

(this makes fail test 00202 of the C test suite)

@windelbouwman windelbouwman added the C frontend Issues related to the C language compiler label Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C frontend Issues related to the C language compiler
Projects
None yet
Development

No branches or pull requests

2 participants