Commit 82b4e51
committed
[libc] fix -Wcast-qual in containerof macro
Fixes the diagnostic observed with gcc-14:
llvm-project/libc/include/llvm-libc-macros/containerof-macro.h:17:13:
error: cast from type ‘const char*’ to type ‘void*’ casts away qualifiers
[-Werror=cast-qual]
17 | (type *)(void *)((const char *)__ptr - offsetof(type, member));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We're trying to turn on more warnings for the tests in llvm#124036, so enable
-Wcast-qual for GCC while we're at it.1 parent d398c0c commit 82b4e51
File tree
2 files changed
+3
-2
lines changed- libc
- cmake/modules
- include/llvm-libc-macros
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
0 commit comments