Skip to content

Commit d90b027

Browse files
committed
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
2 parents 3abc79d + 32a4ec2 commit d90b027

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/uapi/linux/stddef.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
struct TAG { MEMBERS } ATTRS NAME; \
3030
}
3131

32+
#ifdef __cplusplus
33+
/* sizeof(struct{}) is 1 in C++, not 0, can't use C version of the macro. */
34+
#define __DECLARE_FLEX_ARRAY(T, member) \
35+
T member[0]
36+
#else
3237
/**
3338
* __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
3439
*
@@ -49,3 +54,5 @@
4954
#ifndef __counted_by
5055
#define __counted_by(m)
5156
#endif
57+
58+
#endif /* _UAPI_LINUX_STDDEF_H */

0 commit comments

Comments
 (0)