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

Switch from #pragma once to include guards #289

Open
chiphogg opened this issue Sep 2, 2024 · 3 comments
Open

Switch from #pragma once to include guards #289

chiphogg opened this issue Sep 2, 2024 · 3 comments
Labels
⬇️ affects: code (implementation) Affects implementation details of the code 📁 kind: enhancement New feature or request 💪 effort: small
Milestone

Comments

@chiphogg
Copy link
Contributor

chiphogg commented Sep 2, 2024

This would be a more robust solution. #pragma once is fine for first-party code in a project, but for third party users, there will always be edge cases.

@chiphogg
Copy link
Contributor Author

@geoffviola mentions that there may be length restrictions (32 characters?), so we should look into that before we take the leap.

@chiphogg
Copy link
Contributor Author

(On some older compilers)

@geoffviola
Copy link
Contributor

C++ doesn't specify a limit on macro identifier length. C99 and later specifies it as the first 63 characters.

Even though there is no specific limit on the length of identifiers, early compilers had limits on the number of significant initial characters in identifiers and the linkers imposed stricter limits on the names with external linkage.

https://en.cppreference.com/w/c/language/identifier#:~:text=Even%20though%20there%20is%20no,the%20names%20with%20external%20linkage.

@chiphogg chiphogg added 📁 kind: enhancement New feature or request 💪 effort: small ⬇️ affects: code (implementation) Affects implementation details of the code labels Oct 25, 2024
@chiphogg chiphogg added this to the On deck milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬇️ affects: code (implementation) Affects implementation details of the code 📁 kind: enhancement New feature or request 💪 effort: small
Projects
None yet
Development

No branches or pull requests

2 participants