lib/attr.h: Add ATTR_STRING() attribute macro
It signals that a function parameter is a string _before_ the call. Suggested-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
1c464d9a2d
commit
a61cf0068b
@@ -21,5 +21,11 @@
|
||||
# define ATTR_MALLOC(deallocator)
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ >= 14)
|
||||
# define ATTR_STRING(...) [[gnu::null_terminated_string_arg(__VA_ARGS__)]]
|
||||
#else
|
||||
# define ATTR_STRING(...)
|
||||
#endif
|
||||
|
||||
|
||||
#endif // include guard
|
||||
|
||||
Reference in New Issue
Block a user