Commit 2f1bc1c
committed
fix(main): move the stdout buffering call into mcpp.ui
`module;` opens a global module fragment, which is only legal in a module unit.
main.cpp is not one, so the fragment introduced for <cstdio> made it ill-formed:
GCC accepted it silently, Clang rejected it outright ("missing 'module'
declaration at end of global module fragment") and every macOS job — where the
toolchain is Clang — failed to build.
The policy belongs in mcpp.ui anyway: that module already owns "when does output
become visible", already has a legitimate global module fragment for <cstdio>,
and already exports flush() for the Windows half of the same guarantee.
Verified by building mcpp with llvm@22.1.8 locally, not just gcc — the class of
bug this was is invisible to a single-compiler check.1 parent e7771b9 commit 2f1bc1c
2 files changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
| 6 | + | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
| 247 | + | |
| 248 | + | |
240 | 249 | | |
241 | 250 | | |
242 | 251 | | |
| |||
0 commit comments