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

<cassert> has no include guard #4684

Closed
ameerj opened this issue May 22, 2024 · 2 comments
Closed

<cassert> has no include guard #4684

ameerj opened this issue May 22, 2024 · 2 comments
Labels
invalid This issue is incorrect or by design

Comments

@ameerj
Copy link

ameerj commented May 22, 2024

When building LLVM for example, many files include <cassert>, resulting in lots of include churn relating to this header which can be mitigated with an include guard.

Is there a technical reason for the missing include guard for cassert?

STL/stl/inc/cassert

Lines 5 to 7 in 63354c3

// NOTE: no include guard
#include <yvals_core.h>

@frederick-vs-ja
Copy link
Contributor

This is by design. <cassert> and <assert.h> shouldn't have include guard themselves in order to satisfy the requirements in [assertions.assert]/4 and the corresponding requirements in C.

@StephanTLavavej StephanTLavavej added the invalid This issue is incorrect or by design label May 22, 2024
@StephanTLavavej
Copy link
Member

Yep, thanks @frederick-vs-ja.

@StephanTLavavej StephanTLavavej closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This issue is incorrect or by design
Projects
None yet
Development

No branches or pull requests

3 participants