From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id 3ED8F3858437; Mon, 11 Oct 2021 18:16:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ED8F3858437 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc/maskray/clang] Skip undefined va_arg_pack X-Act-Checkin: glibc X-Git-Author: Stan Shebs X-Git-Refname: refs/heads/maskray/clang X-Git-Oldrev: b4e8e08dff4fe4d27a52d01316e6c5e7670b31ab X-Git-Newrev: a2f9788c5f729e09e0eeaf514e816c9bf3f06171 Message-Id: <20211011181603.3ED8F3858437@sourceware.org> Date: Mon, 11 Oct 2021 18:16:03 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2021 18:16:03 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a2f9788c5f729e09e0eeaf514e816c9bf3f06171 commit a2f9788c5f729e09e0eeaf514e816c9bf3f06171 Author: Stan Shebs Date: Fri Jan 19 09:31:04 2018 -0800 Skip undefined va_arg_pack Diff: --- misc/sys/cdefs.h | 5 +++++ sysdeps/generic/ldsodefs.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 4dac9d264d..574a4f1e85 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -406,9 +406,14 @@ /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) +#if defined(__clang__) +# define __va_arg_pack() __VA_ARGS__ +# define __va_arg_pack_len() 0 +#else # define __va_arg_pack() __builtin_va_arg_pack () # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif +#endif /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 9ec1511bb0..f3651ab649 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -808,7 +808,11 @@ _dl_dprintf (int fd, const char *fmt, ...) { /* Use local declaration to avoid includign . */ extern int __dprintf(int fd, const char *format, ...) attribute_hidden; +#if defined(__clang__) + __dprintf (fd, fmt); +#else __dprintf (fd, fmt, __builtin_va_arg_pack ()); +#endif } #endif