-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support "named" variadic macros #164
Comments
Isn't this dangerous/ambiguous? Wasn't the comma right before the |
It seems unambiguous to me. If there is some identifier token prior to the Can you give an example? |
Most likely I'm misremembering things. Please feel free to implement this gcc extension if you feel it is valuable. However, as wave was always meant to be strictly conforming, I'd suggest enabling this feature only based on an explicit option the user has to provide. Wave could even mention this new option in the error message if it discovers the construct, but the option was not enabled. |
Is this still ongoing? I need this feature to compile kernel code and I'd like to help. |
Like many open source libraries, Wave progresses at a rate determined by the energy level and availability of its maintainers :) I think your contribution would be very welcome, particularly given the use of this syntax in the Linux kernel (a popular target of analysis)! I'd be happy to help you get involved. Given that this is a non-standard extension we would need to create a feature flag for it. We support certain MSVC extensions with a macro flag The actual code implementing variadic macros definition starts about here while the expansion is handled here. You are looking for a way to conditionally use a different token (probably an identifier) with a specific name instead of |
@jefftrull Hi, thank you for the suggestion. I just opened up a PR to support this feature. Please let me know if anything is missing or wrong. |
This piece of code appears in recent Ubuntu distributions, in
/usr/include/linux/stddef.h
:The gcc manual notes that names other than
__VA_ARGS__
- in this case,MEMBERS
- may be used to refer to the variadic arguments "as an extension". Given the ubiquity of this header it may be useful to add support for this extension.The text was updated successfully, but these errors were encountered: