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

Potential macro expansion ambiguity in the recursion engine #13

Open
Hirrolot opened this issue Apr 18, 2021 · 0 comments
Open

Potential macro expansion ambiguity in the recursion engine #13

Hirrolot opened this issue Apr 18, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Hirrolot
Copy link
Owner

It seems that the recursion engine relies on one ambiguity in the standard (the issue is about C++ but the C preprocessor is essentially the same):

#define ML99_PRIV_REC_NEXT(next_lvl, choice) ML99_PRIV_REC_NEXT_##choice(next_lvl)

Here, ML99_PRIV_REC_NEXT can expand to ML99_PRIV_REC_<level>, which is then invoked by a caller of ML99_PRIV_REC_NEXT, thus resulting in the ML99_PRIV_REC_NEXT token once again.

However, I haven't noticed any problems with various compilers yet as they seem to treat this ambiguity in the same way. Please, let me know if your compiler doesn't work because of it; to make sure, run tests/eval/rec.c.

@Hirrolot Hirrolot added the bug Something isn't working label Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant