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

Custom linter: Add requirement for _OFFSET variable names to be lowercase #170

Open
MonsterDruide1 opened this issue Sep 29, 2024 · 3 comments

Comments

@MonsterDruide1
Copy link
Owner

Example: _1d8, _c8, ...

Reason for this is that Begins with underscore and uppercase letter are technically reserved by the C++ spec and should not be used for own variable names. _C throws an error in some compilers, while _c does not - thus, we should use the latter, to improve compatibility with different systems.

Source: https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685

@GRAnimated
Copy link
Collaborator

What about the difference between field_xxx and _xxx? HexRaysPyTools generates field_xxx (and the fork I use adds the generated type into the name, like char_xxx) while the built-in struct creator uses _xxx. I'm far more in favor of field_xxx for the record.

@ThePixelGamer
Copy link

Isn't "field" already just implied by the _xxx scheme?

@MonsterDruide1
Copy link
Owner Author

That's also what I'm thinking. It does not add information/value, just make the name longer, and one advantage of having a very short name for these placeholders is that they stick out from proper namings, are immediately apparent that they do not have their final name yet and thus need to be adjusted.

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

No branches or pull requests

3 participants