-
Notifications
You must be signed in to change notification settings - Fork 2
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
reserved identifier violation #11
Comments
Thanks for reminding me. I know they are non-compliant in C++ for a while, but not for the reason outlined in the link. Current C++ draft says in [lex.name]:
So I would change ids to look like |
🤔 Some identifiers will need further development considerations for this issue because of the usage of double underscores. |
Thanks for your adjustment of some affected include guards. 💭 Can further implementation details be reconsidered accordingly?
|
That's not my code. I can update |
💭 I suggest to reconsider your interpretation of provided information.
Would you like to take descriptions for undefined behavior better into account? 🤔 |
Yes.
Proportionally to the negative effects non-compliance can have. Also some of third-party code is auto-generated and it's better to fix the generator (output of tree-sitter and also headers in its runtime).
Don't know how they derived that. From "shall not"? Maybe there is some additional clause somewhere. The behaviour is quite clear here: code may not compile if header guard will clash with an id defined by a toolchain. |
💭 I suggest to reconsider also such an expectation. I got the impression that it can be challenging to avoid the tampering with the reserved name space. 🔮 Will any more code reviewers and developers get into the mood to take another look at information according to the standard wording “…, or defines a reserved identifier as a macro name, the behavior is undefined.”? |
I just don't want to fix this in my copy of other projects, then forget and undo it. These fixes should be done upstream in Catch and tree-sitter. Otherwise if I decide to switch to, say, xmake build system and pull these dependencies as packages, those packages will contain broken ids anyway. Fixing it locally won't achieve much. Such ids generally don't bother me, but since you're into reporting issues in various projects, I thought you'd want to raise the issue with corresponding upstreams.
It's probably derived from definition of "undefined behaviour" at http://eel.is/c++draft/defns.undefined. |
🔮 Will software development attention grow for the avoidance of undefined behaviour?
💭 Can the referenced software components be clearly identified (and the corresponding issue trackers)? |
Not all UBs are equal. Those cases which the standard explicitly calls out as undefined are the most severe ones, non-compliance is a different kind of UB, which doesn't need the same level of attention.
Looks like it was fixed a year ago in Catch2, so I just need to update it. tree-sitter's part is here: https://github.com/tree-sitter/tree-sitter/tree/master/lib/src/unicode. I confused something for being autogenerated, looks like only these files borrowed from ICU need to be updated. |
This is mainly to fix use of reserved identifiers. Thanks to Markus Elfring (a.k.a. elfring). Related to #11 on GitHub.
To not use reserved identifiers. The source of these files is unlikely to get updated, it was done for a conference. Thanks to Markus Elfring (a.k.a. elfring). Related to #11 on GitHub.
🔮 How will the chances evolve to convince involved developers for further adjustments of affected source code? Can any more double underscores be omitted from a software component like “polymorphic_allocator”? |
To not use reserved identifiers. The source of these files is unlikely to get updated, it was done for a conference. Thanks to Markus Elfring (a.k.a. elfring). Related to #11 on GitHub.
Not sure what you're asking here, please rephrase.
Thanks, was looking only at defines.
Isn't worth it to get rid only of |
A fraction of developers cares for discussed implementation details to some degree. 🤔 Further clarification can help for the influence of Unicode parts on the software like “Tree-sitter”, can't it? |
So you worry they will also be reluctant to adjust headers because those are borrowed from ICU? Might be, ICU also haven't updated their guards, so pulling new version won't help. However, tree-sitter's runtime is meant for direct inclusion into other projects, in this case updating guards in place is quite justified. Also names like |
🤔 I am unsure how much “ICU” contributors will care for remaining C/C++ compliance concerns. |
Me neither, but given the size of the change they might be fine doing an update. There are grounds for avoiding such generic names for sure, I know one project using |
I would like to point out that an identifier like “
ZOGRASCOPE__HIGHLIGHTER_HPP__
” does not fit to the expected naming convention of the C++ language standard.Would you like to adjust your selection for unique names?
The text was updated successfully, but these errors were encountered: