Commit a3eeef7
committed
Scope the base_macros.h warning disables to base.h
base_macros.h disables C5046, C4268, C4499 and C4630 without a matching
#pragma warning(push)/(pop) pair. base.h includes it near the top and never
restores the warning state, so those four warnings stay disabled for the rest
of every translation unit that includes base.h, not just for the C++/WinRT
declarations they were added for.
Consumers silently lose the warnings in their own code:
namespace { struct S { int x; }; }
S f();
int main() { f(); }
That warns C5046 on its own, and stops warning as soon as <winrt/base.h> is
included ahead of it, at both /W4 and /Wall.
Open the scope before the include and close it at the end of base.h. The
disables still cover everything C++/WinRT declares, and the warning state is
handed back to the consumer unchanged. The set of warnings reported from
within the C++/WinRT headers is unaffected.1 parent 856eaff commit a3eeef7
3 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
120 | 147 | | |
121 | 148 | | |
122 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
0 commit comments