Merge "Always use __foo__ for attribute names." into main

This commit is contained in:
Elliott Hughes 2024-04-23 00:12:32 +00:00 committed by Gerrit Code Review
commit 5063d26249
7 changed files with 32 additions and 32 deletions

View file

@ -20,15 +20,15 @@
// we should only annotate headers when we are running versioner.
#if defined(__BIONIC_VERSIONER)
#define __INTRODUCED_IN(api_level) __attribute__((annotate("introduced_in=" #api_level)))
#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __attribute__((annotate("introduced_in=" #api_level))) __VERSIONER_NO_GUARD
#define __DEPRECATED_IN(api_level) __attribute__((annotate("deprecated_in=" #api_level)))
#define __REMOVED_IN(api_level) __attribute__((annotate("obsoleted_in=" #api_level)))
#define __INTRODUCED_IN_32(api_level) __attribute__((annotate("introduced_in_32=" #api_level)))
#define __INTRODUCED_IN_64(api_level) __attribute__((annotate("introduced_in_64=" #api_level)))
#define __INTRODUCED_IN(api_level) __attribute__((__annotate__("introduced_in=" #api_level)))
#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __attribute__((__annotate__("introduced_in=" #api_level))) __VERSIONER_NO_GUARD
#define __DEPRECATED_IN(api_level) __attribute__((__annotate__("deprecated_in=" #api_level)))
#define __REMOVED_IN(api_level) __attribute__((__annotate__("obsoleted_in=" #api_level)))
#define __INTRODUCED_IN_32(api_level) __attribute__((__annotate__("introduced_in_32=" #api_level)))
#define __INTRODUCED_IN_64(api_level) __attribute__((__annotate__("introduced_in_64=" #api_level)))
#define __VERSIONER_NO_GUARD __attribute__((annotate("versioner_no_guard")))
#define __VERSIONER_FORTIFY_INLINE __attribute__((annotate("versioner_fortify_inline")))
#define __VERSIONER_NO_GUARD __attribute__((__annotate__("versioner_no_guard")))
#define __VERSIONER_FORTIFY_INLINE __attribute__((__annotate__("versioner_fortify_inline")))
#else

View file

@ -138,11 +138,11 @@ typedef enum {
* 7.17.4 Fences.
*/
static inline void atomic_thread_fence(memory_order __order __attribute__((unused))) {
static inline void atomic_thread_fence(memory_order __order __attribute__((__unused__))) {
__c11_atomic_thread_fence(__order);
}
static inline void atomic_signal_fence(memory_order __order __attribute__((unused))) {
static inline void atomic_signal_fence(memory_order __order __attribute__((__unused__))) {
__c11_atomic_signal_fence(__order);
}

View file

@ -39,6 +39,6 @@ struct __sFILE {
#else
char __private[84];
#endif
} __attribute__((aligned(sizeof(void*))));
} __attribute__((__aligned__(sizeof(void*))));
__END_DECLS

View file

@ -86,17 +86,17 @@ int sigwait(const sigset_t* _Nonnull __set, int* _Nonnull __signal);
int sigwait64(const sigset64_t* _Nonnull __set, int* _Nonnull __signal) __INTRODUCED_IN(28);
int sighold(int __signal)
__attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
__attribute__((__deprecated__("use sigprocmask() or pthread_sigmask() instead")))
__INTRODUCED_IN(26);
int sigignore(int __signal)
__attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN(26);
__attribute__((__deprecated__("use sigaction() instead"))) __INTRODUCED_IN(26);
int sigpause(int __signal)
__attribute__((deprecated("use sigsuspend() instead"))) __INTRODUCED_IN(26);
__attribute__((__deprecated__("use sigsuspend() instead"))) __INTRODUCED_IN(26);
int sigrelse(int __signal)
__attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
__attribute__((__deprecated__("use sigprocmask() or pthread_sigmask() instead")))
__INTRODUCED_IN(26);
sighandler_t _Nonnull sigset(int __signal, sighandler_t _Nullable __handler)
__attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN(26);
__attribute__((__deprecated__("use sigaction() instead"))) __INTRODUCED_IN(26);
int raise(int __signal);
int kill(pid_t __pid, int __signal);

View file

@ -141,7 +141,7 @@ int vdprintf(int __fd, const char* _Nonnull __fmt, va_list __args) __printflike(
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 201112L) || \
(defined(__cplusplus) && __cplusplus <= 201103L)
char* _Nullable gets(char* _Nonnull __buf) __attribute__((deprecated("gets is unsafe, use fgets instead")));
char* _Nullable gets(char* _Nonnull __buf) __attribute__((__deprecated__("gets is unsafe, use fgets instead")));
#endif
int sprintf(char* __BIONIC_COMPLICATED_NULLNESS __s, const char* _Nonnull __fmt, ...)
__printflike(2, 3) __warnattr_strict("sprintf is often misused; please use snprintf");

View file

@ -57,7 +57,7 @@ int unsetenv(const char* _Nonnull __name);
int clearenv(void);
char* _Nullable mkdtemp(char* _Nonnull __template);
char* _Nullable mktemp(char* _Nonnull __template) __attribute__((deprecated("mktemp is unsafe, use mkstemp or tmpfile instead")));
char* _Nullable mktemp(char* _Nonnull __template) __attribute__((__deprecated__("mktemp is unsafe, use mkstemp or tmpfile instead")));
int mkostemp64(char* _Nonnull __template, int __flags) __INTRODUCED_IN(23);
int mkostemp(char* _Nonnull __template, int __flags) __INTRODUCED_IN(23);

View file

@ -139,12 +139,12 @@
#define __wur __attribute__((__warn_unused_result__))
#define __errorattr(msg) __attribute__((unavailable(msg)))
#define __warnattr(msg) __attribute__((deprecated(msg)))
#define __warnattr_real(msg) __attribute__((deprecated(msg)))
#define __enable_if(cond, msg) __attribute__((enable_if(cond, msg)))
#define __clang_error_if(cond, msg) __attribute__((diagnose_if(cond, msg, "error")))
#define __clang_warning_if(cond, msg) __attribute__((diagnose_if(cond, msg, "warning")))
#define __errorattr(msg) __attribute__((__unavailable__(msg)))
#define __warnattr(msg) __attribute__((__deprecated__(msg)))
#define __warnattr_real(msg) __attribute__((__deprecated__(msg)))
#define __enable_if(cond, msg) __attribute__((__enable_if__(cond, msg)))
#define __clang_error_if(cond, msg) __attribute__((__diagnose_if__(cond, msg, "error")))
#define __clang_warning_if(cond, msg) __attribute__((__diagnose_if__(cond, msg, "warning")))
#if defined(ANDROID_STRICT)
/*
@ -248,7 +248,7 @@
#if defined(__BIONIC_FORTIFY)
# define __bos0(s) __bosn((s), 0)
# define __pass_object_size_n(n) __attribute__((pass_object_size(n)))
# define __pass_object_size_n(n) __attribute__((__pass_object_size__(n)))
/*
* FORTIFY'ed functions all have either enable_if or pass_object_size, which
* makes taking their address impossible. Saying (&read)(foo, bar, baz); will
@ -260,7 +260,7 @@
* them available externally. FORTIFY'ed functions try to be as close to possible as 'invisible';
* having stack protectors detracts from that (b/182948263).
*/
# define __BIONIC_FORTIFY_INLINE static inline __attribute__((no_stack_protector)) \
# define __BIONIC_FORTIFY_INLINE static inline __attribute__((__no_stack_protector__)) \
__always_inline __VERSIONER_FORTIFY_INLINE
/*
* We should use __BIONIC_FORTIFY_VARIADIC instead of __BIONIC_FORTIFY_INLINE
@ -270,7 +270,7 @@
*/
# define __BIONIC_FORTIFY_VARIADIC static inline
/* Error functions don't have bodies, so they can just be static. */
# define __BIONIC_ERROR_FUNCTION_VISIBILITY static __attribute__((unused))
# define __BIONIC_ERROR_FUNCTION_VISIBILITY static __attribute__((__unused__))
#else
/* Further increase sharing for some inline functions */
# define __pass_object_size_n(n)
@ -300,21 +300,21 @@
# define __BIONIC_INCLUDE_FORTIFY_HEADERS 1
#endif
#define __overloadable __attribute__((overloadable))
#define __overloadable __attribute__((__overloadable__))
#define __diagnose_as_builtin(...) __attribute__((diagnose_as_builtin(__VA_ARGS__)))
#define __diagnose_as_builtin(...) __attribute__((__diagnose_as_builtin__(__VA_ARGS__)))
/* Used to tag non-static symbols that are private and never exposed by the shared library. */
#define __LIBC_HIDDEN__ __attribute__((visibility("hidden")))
#define __LIBC_HIDDEN__ __attribute__((__visibility__("hidden")))
/*
* Used to tag symbols that should be hidden for 64-bit,
* but visible to preserve binary compatibility for LP32.
*/
#ifdef __LP64__
#define __LIBC32_LEGACY_PUBLIC__ __attribute__((visibility("hidden")))
#define __LIBC32_LEGACY_PUBLIC__ __attribute__((__visibility__("hidden")))
#else
#define __LIBC32_LEGACY_PUBLIC__ __attribute__((visibility("default")))
#define __LIBC32_LEGACY_PUBLIC__ __attribute__((__visibility__("default")))
#endif
/* Used to rename functions so that the compiler emits a call to 'x' rather than the function this was applied to. */