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

Add compiler warning for preprocessor replacement within integer literals #3

Open
rcgoodfellow opened this issue Jun 24, 2022 · 0 comments

Comments

@rcgoodfellow
Copy link
Collaborator

rcgoodfellow commented Jun 24, 2022

From this Stack Overflow thread

Similar considerations mean that _ can't be used either; if there is a #define _234 * 2, then a[1_234] would silently change the meaning of the code.

As _ is the integer literal separator in p4, this silent code modification could sneak up and bite someone. We should detect and emit a warning here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant