Commit 0d82a50
Fix header_hygiene CI: skip pthread guards on libstdc++ in thread mode
CI on Linux failed `header_hygiene` because libstdc++ in -D_REENTRANT mode
(set unconditionally by configure.ac) routes std::thread support through
<bits/gthr-default.h>, which #includes <pthread.h> directly. That defines
_PTHREAD_H once any STL container header (<memory>, <string>, <vector>, ...)
is reached -- so the runtime sentinel reported a leak even though no
libhttpserver public header pulls <pthread.h> in.
This is the same STL implementation detail we already exempt for libc++
via _LIBCPP_VERSION; the original test comment claimed libstdc++ did not
have this property, which was incorrect for thread-enabled builds.
Extend the existing skip to also fire on libstdc++ in thread mode by
testing _GLIBCXX_HAS_GTHREADS, and update the matching comment in
Makefile.am so the asymmetry between the runtime sentinel and the
preprocessor-grep gate (which already excludes pthread) is documented
consistently. The guard still fires under STLs that don't route
std::thread through pthread (e.g. MSVC's Microsoft STL).
Verified locally:
- macOS libc++: header_hygiene PASS (unchanged).
- gcc:14 libstdc++ -D_REENTRANT: pre-fix the test reproduces the exact
CI failure ("1 forbidden header(s) leaked"); post-fix it PASSes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0bfbe85 commit 0d82a50
2 files changed
Lines changed: 40 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | | - | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
0 commit comments