Fixes: 19728f31ae42 ("sys/_types.h: Unbreak gcc build")
Details
Details
- Reviewers
brooks dim emaste - Group Reviewers
srcmgr - Commits
- rG029a09f18032: sys/_types.h: Actually unbreak gcc build
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
So I checked and the preprocessor _does_ do short-circuit evaluation of boolean expressions, so this shouldn't be necessary, yet gcc complains:
sys/sys/_types.h:164:46: error: missing binary operator before token "("
164 | #if !defined(__has_feature) || !__has_feature(capabilities)
| ^| sys/sys/_types.h | ||
|---|---|---|
| 167 | Why not just write #ifdef __has_feature #if !__has_feature(capabilities) ? With that change, the gcc13 build completes successfully for me. | |
| sys/sys/_types.h | ||
|---|---|---|
| 167 | Because that inverts the logic. We want these lines included in all cases /except/ when the compiler has the capabilities feature. | |