[clang] [Clang] Warn when an explicit alignment is weakened by other directives (PR #198417)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 18 16:51:35 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 53968 tests passed
* 1227 tests skipped
* 5 tests failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.Sema/bitfield-layout_1.c</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc C:\_work\llvm-project\llvm-project\clang\test\Sema\bitfield-layout_1.c -fsyntax-only -verify -triple=i686-apple-darwin9
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc 'C:\_work\llvm-project\llvm-project\clang\test\Sema\bitfield-layout_1.c' -fsyntax-only -verify -triple=i686-apple-darwin9
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\bitfield-layout_1.c Line 199: explicit alignment of a (8 bytes) was weakened to 2 bytes
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.Sema/pragma-align-packed.c</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple i386-apple-darwin9 -fsyntax-only -verify C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-align-packed.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple i386-apple-darwin9 -fsyntax-only -verify 'C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-align-packed.c'
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-align-packed.c Line 7: explicit alignment of f1 (4 bytes) was weakened to 1 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-align-packed.c Line 21: explicit alignment of f1 (4 bytes) was weakened to 1 bytes
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.Sema/pragma-pack-4.c</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple i686-apple-darwin9 C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-pack-4.c -fsyntax-only -verify
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple i686-apple-darwin9 'C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-pack-4.c' -fsyntax-only -verify
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-pack-4.c Line 8: explicit alignment of a (8 bytes) was weakened to 4 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-pack-4.c Line 9: explicit alignment of b (8 bytes) was weakened to 4 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\pragma-pack-4.c Line 10: explicit alignment of c (8 bytes) was weakened to 4 bytes
# | 3 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.Sema/test-wunaligned-access.c</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c -triple=armv7-none-none-eabi -verify -Wunaligned-access -emit-llvm -o C:\_work\llvm-project\llvm-project\build\tools\clang\test\Sema\Output\test-wunaligned-access.c.tmp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc 'C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c' -triple=armv7-none-none-eabi -verify -Wunaligned-access -emit-llvm -o 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Sema\Output\test-wunaligned-access.c.tmp'
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c Line 109: explicit alignment of b (4 bytes) was weakened to 1 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c Line 130: explicit alignment of d (4 bytes) was weakened to 1 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c Line 136: explicit alignment of c (4 bytes) was weakened to 1 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c Line 160: explicit alignment of d (4 bytes) was weakened to 1 bytes
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.c Line 333: explicit alignment of b (4 bytes) was weakened to 1 bytes
# | 5 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.Sema/test-wunaligned-access.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.cpp -triple=armv7-none-none-eabi -verify -Wunaligned-access -emit-llvm -o C:\_work\llvm-project\llvm-project\build\tools\clang\test\Sema\Output\test-wunaligned-access.cpp.tmp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc 'C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.cpp' -triple=armv7-none-none-eabi -verify -Wunaligned-access -emit-llvm -o 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Sema\Output\test-wunaligned-access.cpp.tmp'
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# | File C:\_work\llvm-project\llvm-project\clang\test\Sema\test-wunaligned-access.cpp Line 71: explicit alignment of b (4 bytes) was weakened to 1 bytes
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/198417
More information about the cfe-commits
mailing list