<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63859>63859</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Overly aggressive "unterminated '#pragma clang attribute push' at end of file" error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tweenk
</td>
</tr>
</table>
<pre>
This error should be reported only at the end of a translation unit, not at the end of a file. Otherwise it prevents the following useful usage pattern:
some_header.h:
```
#include "defs.inc"
inline uint32_t add_with_rollover(uint32_t x) {
return x + 1;
}
#include "undefs.inc"
```
defs.inc:
```
#pragma clang attribute push(__attribute__((no_sanitize("unsigned-integer-overflow)), apply_to=function)
```
undefs.inc:
```
#pragma clang attribute pop
```
Currently this will give an error at the end of defs.inc, but I think it should not give an error at all. It should only give an error if the pop is missing from undefs.inc.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclEGvqygUxz8Nbk5qFLTqwsXcNk3e6m1mb1CPyjwEA4f2dT79BNv0zrt3Zm4yCcHI_wDnf_iB9F7NBrFl5Rsrz4kMtFjX0g3R_Eh6O97b3xflAZ2zDvxigx6hR3C4WUc4gjX6DpKAFgQ0I9gJJJCTxmtJyhoIRhHjJzCWPsVNSmMK32lBd1MeQRFsDq9oyO-Bk9Xa3pSZIXicgobg5YywSSJ0honfWHZm2bP3dsVuQTmiS5cPGjtmz_b45UKZQYcRgXE-4uRTZQbG-UNWRiuDEJQhwTsCOY7dTdHSuZjPFR3j9Uv8yXgDwKq3x1wAhxScgZ_A-BvkTDwFVp3_afNgPm3_Mdm9f0V9ZWxzcl4lDFqaGSSRU30ghC34hfG6615DXcd4zXhtbOelUaT-xH2AB7MzMR6UIZzRHaLlSdsb483eTiC3Td87skycp2CGeNBR-ff0_2bz_xqw23-sfwrOoSF9B4q43pTWMKsrgjRPdn9l773oJ-gDwbc4z_yIBD4hj7x-WkFqncK3V8wO_69Batq32ewGysOqvI_4Ts6u8F6DNBlbMTaikQm2-bFuRFZXIkuWNq_LI-aj6IdmFLXIhjLDYz0OKKe8KvIqUS3PuMiqvMgKXoosLYtC5EWFMhd9LuuGFRmuUulU6-uaWjcnyvuA7VHUZZNo2aP2-23n3OANdjGiV54T18Y5hz7MnhWZVp78-yqkSGP7_YouXvh5duh9dL4DQ-hWZWR8EBivvqKwiqV8HkR8Ahjnj-olwel2Idp8pIRfGL_MipbQp4NdGb_EZJ6fw-bsHzgQ45fdgmf8slv8KwAA__-di4Wv">