mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
compiler: Add __designated_init annotation
This allows structure annotations for requiring designated initialization in GCC 5.1.0 and later: https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html The structure randomization layout plugin will be using this to help identify structures that need this form of initialization. Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
1132e1e448
commit
0aa5e49c68
2 changed files with 12 additions and 0 deletions
|
@ -294,6 +294,14 @@
|
|||
#define __no_sanitize_address __attribute__((no_sanitize_address))
|
||||
#endif
|
||||
|
||||
#if GCC_VERSION >= 50100
|
||||
/*
|
||||
* Mark structures as requiring designated initializers.
|
||||
* https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
|
||||
*/
|
||||
#define __designated_init __attribute__((designated_init))
|
||||
#endif
|
||||
|
||||
#endif /* gcc version >= 40000 specific checks */
|
||||
|
||||
#if !defined(__noclone)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue