mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-08 00:57:30 +00:00
When compiling with GCC 15 using `CFLAGS=-march=x86-64-v4`, the compiler's
aggressively optimized vectorizer triggers a false-positive
-Wstringop-overflow error. Because x86-64-v4 enables wide AVX-512 registers,
the compiler misinterprets the loop unrolling and warns that a 64-byte
vector write is overflowing the destination buffer:
```
tpm2/TPMCmd/tpm/src/crypt/AlgorithmTests.c:158:17: error:
writing 64 bytes into a region of size 15 [-Werror=stringop-overflow=]
158 | *iv = i;
```
This fixes the warning by marking the `iv` output pointer parameter as
`volatile`. This inhibits the over-aggressive loop vectorization on this
specific buffer, silencing the compiler error without changing the
underlying logic.
Signed-off-by: Arthur Gautier <arthur.gautier@arista.com>
|
||
|---|---|---|
| .. | ||
| tpm2 | ||
| tpm12 | ||
| compiler.h | ||
| disabled_interface.c | ||
| libtpms.syms | ||
| Makefile.am | ||
| test.syms | ||
| tpm_debug.c | ||
| tpm_debug.h | ||
| tpm_library_conf.h | ||
| tpm_library_intern.h | ||
| tpm_library.c | ||
| tpm_memory.c | ||
| tpm_nvfile.c | ||
| tpm_nvfile.h | ||
| tpm_tpm2_interface.c | ||
| tpm_tpm2_tis.c | ||
| tpm_tpm12_interface.c | ||
| tpm_tpm12_tis.c | ||