diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-23 01:46:55 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-23 01:46:55 +0200 |
commit | d90b0276af8f25a0b8ae081a30d1b2a61263393b (patch) | |
tree | c46ab3135283da10cdf632e41c92eef4b0b705a5 /include | |
parent | Merge tag 'xfs-6.6-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff) | |
parent | uapi: stddef.h: Fix __DECLARE_FLEX_ARRAY for C++ (diff) | |
download | linux-d90b0276af8f25a0b8ae081a30d1b2a61263393b.tar.xz linux-d90b0276af8f25a0b8ae081a30d1b2a61263393b.zip |
Merge tag 'hardening-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook:
- Fix UAPI stddef.h to avoid C++-ism (Alexey Dobriyan)
- Fix harmless UAPI stddef.h header guard endif (Alexey Dobriyan)
* tag 'hardening-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
uapi: stddef.h: Fix __DECLARE_FLEX_ARRAY for C++
uapi: stddef.h: Fix header guard location
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/stddef.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h index 7c3fc3980881..5c6c4269f7ef 100644 --- a/include/uapi/linux/stddef.h +++ b/include/uapi/linux/stddef.h @@ -29,6 +29,11 @@ struct TAG { MEMBERS } ATTRS NAME; \ } +#ifdef __cplusplus +/* sizeof(struct{}) is 1 in C++, not 0, can't use C version of the macro. */ +#define __DECLARE_FLEX_ARRAY(T, member) \ + T member[0] +#else /** * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union * @@ -49,3 +54,5 @@ #ifndef __counted_by #define __counted_by(m) #endif + +#endif /* _UAPI_LINUX_STDDEF_H */ |