From d0f960a634e07c073283e66caf86d37d695113d1 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 10 Sep 2021 19:23:42 +0200 Subject: [PATCH] newlib: don't use gcc-specific pragmas for clang --- components/newlib/syscalls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/newlib/syscalls.c b/components/newlib/syscalls.c index d6c3098592..19bd7a48ce 100644 --- a/components/newlib/syscalls.c +++ b/components/newlib/syscalls.c @@ -79,8 +79,10 @@ ssize_t _write_r(struct _reent *r, int fd, const void * data, size_t size) * doesn't have the same signature as the original function. * Disable type mismatch warnings for this reason. */ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wattribute-alias" +#endif int _open_r(struct _reent *r, const char * path, int flags, int mode) __attribute__((weak,alias("syscall_not_implemented"))); @@ -122,7 +124,9 @@ int _kill_r(struct _reent *r, int pid, int sig) void _exit(int __status) __attribute__((alias("syscall_not_implemented_aborts"))); +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif /* Replaces newlib fcntl, which has been compiled without HAVE_FCNTL */ int fcntl(int fd, int cmd, ...)