You can read more about these attributes here: https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Constructing-Calls.html
These are needed to support C++-compatible _FORTIFY_SOURCE wrappers for libc function (these can't be done with macros). For instance, without these attributes, there isn't any way to write the following:
extern inline __attribute__((gnu_inline)) int sprintf(char *str, const char *fmt, ...) { return __builtin___sprintf_chk(str, 0, __builtin_object_size(str, 0), fmt, __builtin_va_arg_pack()); }
Fixes llvm.org/PR7219 & rdar://11102669
Thanks for taking a look!
Erik