public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/maskray/clang] Skip undefined va_arg_pack
Date: Mon, 11 Oct 2021 18:16:03 +0000 (GMT)	[thread overview]
Message-ID: <20211011181603.3ED8F3858437@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a2f9788c5f729e09e0eeaf514e816c9bf3f06171

commit a2f9788c5f729e09e0eeaf514e816c9bf3f06171
Author: Stan Shebs <stanshebs@google.com>
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 <stdio.h>.  */
   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


             reply	other threads:[~2021-10-11 18:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 18:16 Fangrui Song [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-03  7:41 Fangrui Song
2021-11-02 20:00 Fangrui Song
2021-10-20 21:24 Fangrui Song
2021-10-19 17:01 Fangrui Song
2021-10-10 23:12 Fangrui Song
2021-10-07 20:13 Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011181603.3ED8F3858437@sourceware.org \
    --to=maskray@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).