summaryrefslogtreecommitdiff
path: root/tests/test-printf-posix.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-11 01:53:13 +0200
committerBruno Haible <bruno@clisp.org>2020-08-11 01:53:13 +0200
commit01b5720b10727306c043327c0693203a6f77379b (patch)
treee32c03cb7f5411f7d570b7de9f81825cbddb0194 /tests/test-printf-posix.c
parent81d65ad9b9df5cdfd4dd1deb7b712b6e907dd9db (diff)
downloadgnulib-01b5720b10727306c043327c0693203a6f77379b.tar.gz
Use many __attribute__s with clang.
* m4/gnulib-common.m4 (_Noreturn): Use __attribute__ __noreturn__ also on clang. * lib/cdefs.h (__glibc_clang_has_attribute, __glibc_clang_has_builtin): New macros. (__THROW, __THROWNL, __NTH, __NTHNL): Use __attribute__ __nothrow__ also on clang. (__warndecl, __warnattr, __errordecl): Use __attribute__ __diagnose_if__ also on older clang versions. (__attribute__): Don't define to empty on clang. (__attribute_malloc__): Use __attribute__ __malloc__ also on clang. (__attribute_pure__): Use __attribute__ __pure__ also on clang. (__attribute_const__): Use __attribute__ __const__ also on clang. (__attribute_used__): Use __attribute__ __used__ also on clang. (__attribute_noinline__): Use __attribute__ __noinline__ also on clang. (__attribute_deprecated__): Use __attribute__ __deprecated__ also on clang. (__attribute_format_arg__): Use __attribute__ __format_arg__ also on clang. (__attribute_format_strfmon__): Use __attribute__ __format__ __strfmon__ also on clang. (__nonnull): Use __attribute__ __nonnull__ also on clang. (__attribute_warn_unused_result__): Use __attribute__ __warn_unused_result__ also on clang. (__always_inline): Use __attribute__ __always_inline__ also on clang. (__attribute_artificial__): Use __attribute__ __artificial__ also on clang >= 7. (__glibc_unlikely, __glibc_likely): Use __builtin_expect also on older clang versions. (_Noreturn): Don't redefine on clang >= 3.5. * lib/arg-nonnull.h (_GL_ARG_NONNULL): Use __attribute__ __nonnull__ also on clang. * lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Use __attribute__ __pure__ also on clang. * lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT): Use __attribute__ __format__ also on clang. * lib/monetary.in.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/textstyle.in.h (ostream_printf, ostream_vprintf): Likewise. * lib/unitypes.in.h (_UC_ATTRIBUTE_CONST): Use __attribute__ __const__ also on clang. (_UC_ATTRIBUTE_PURE): Use __attribute__ __pure__ also on clang. * lib/noreturn.h (_GL_NORETURN_FUNC, _GL_NORETURN_FUNCPTR): Use __attribute__ __noreturn__ also on clang. * lib/obstack.h (__attribute_noreturn__): Likewise. * lib/file-set.h (record_file): Use __attribute__ __nonnull__ also on clang. * lib/argp-help.c (hol_entry_long_iterate): Use __attribute__ always_inline also on clang. * tests/test-printf-posix.c (func1, func2, func3, func4): Test also on clang.
Diffstat (limited to 'tests/test-printf-posix.c')
-rw-r--r--tests/test-printf-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-printf-posix.c b/tests/test-printf-posix.c
index 124587a6a4..b0af595aec 100644
--- a/tests/test-printf-posix.c
+++ b/tests/test-printf-posix.c
@@ -39,7 +39,7 @@ main (int argc, char *argv[])
}
/* Test whether __attribute__ (__format__ (...)) still works. */
-#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !defined __STRICT_ANSI__
+#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__) && !defined __STRICT_ANSI__
extern int func1 (char *, size_t, const char *, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern int func2 (char *, size_t, const char *, ...)