Commit e0bc5c2
authored
clang > 20.1.4 compat: unterminated strings (WebAssembly#584)
clang introduced a new warning (following gcc) for string initialization
to char arrays that do not fit the null terminal.
Introduced here: llvm/llvm-project#137829
Included in LLVM version [LLVM
20.1.4](https://github.com/llvm/llvm-project/releases/tag/llvmorg-20.1.4)+
More detail:
-Wunterminated-string-initialization warns for c string literals that
are written to a buffer too small to include a null terminator. This
warning is also included in -Wextra which is enabled for wasi-libc and
fails compilation due to -Werror.
Possible fixes:
1. deactivate the warning
2. add `__attribute__ ((nonstring))` to the three occurrences where this
is a problem.
Chosen solution: 1.
Since the attribute is not available on older clang versions, it would
trigger another warning there.
(included a small formatting change in the commit - pls ignore)1 parent 6b2d6bd commit e0bc5c2
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
| 426 | + | |
426 | 427 | | |
427 | 428 | | |
428 | 429 | | |
| |||
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
741 | | - | |
| 742 | + | |
742 | 743 | | |
743 | 744 | | |
744 | 745 | | |
| |||
0 commit comments