From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19692 invoked from network); 24 May 2023 14:01:52 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 24 May 2023 14:01:52 -0000 Received: (qmail 30659 invoked by uid 550); 24 May 2023 14:01:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30626 invoked from network); 24 May 2023 14:01:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=message-id:in-reply-to:references:from:date:to: resent-date:resent-from:subject:resent-message-id: resent-to; bh=zdOBrekDprHVSWuDEFFKfkyi9cG7Aa/PYmtnmlTOk4s=; b=HOgKIYpMJerOI9eGSae6YQUyhE6gS9Uo++oz2j+uOi7PUTsml28UKUvR 13e5RTDkIoH078tK7dKnv9yy6/f5jhM3VMdmp2BmgzI1HS3QykykpZcIe BJuxk+QReOcA2P3u+OuBjgyW5DRKEgvS3l4/Jd3SQLhP1uHpCpMhpSKL/ A=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=jens.gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.00,189,1681164000"; d="scan'208";a="56883704" Message-Id: <201523a466d22fe81ce15f884e3d404be9a32f8c.1684932861.git.Jens.Gustedt@inria.fr> In-Reply-To: References: From: Jens Gustedt Date: Wed, 19 Apr 2023 15:56:43 +0200 To: musl@lists.openwall.com Resent-Date: Wed, 24 May 2023 15:59:01 +0200 Resent-From: =?UTF-8?B?SuKCkeKCmeKCmw==?= Gustedt Resent-Message-ID: <20230524155901.026dd0e8@inria.fr> Resent-To: musl@lists.openwall.com Subject: [musl] [C23 divers headers 14/17] C23: allow va_start to receive only one argument C23 allows functions that only have ... and no other arguments. Therefore the second argument to va_start, that was not useful anymore, has been removed. For backwards compatibility it is still possible to provide such an argument and the va_start macro has to be adapted such that it is able to cope with one or two arguments. We take care of this by using the new __VA_OPT__ preprocessing feature, for which we also construct a feature test on the fly. --- include/stdarg.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/stdarg.h b/include/stdarg.h index 3256f805..38db6257 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -1,5 +1,5 @@ -#ifndef _STDARG_H -#define _STDARG_H +#ifndef __STDC_VERSION_STDARG_H__ +#define __STDC_VERSION_STDARG_H__ 202311L #ifdef __cplusplus extern "C" { @@ -9,7 +9,10 @@ extern "C" { #include -#define va_start(v,l) __builtin_va_start(v,l) +#define va_start(...) __va_start1(__VA_ARGS__ , 0, ) +#define __va_start1(...) __va_start2(__VA_ARGS__) +#define __va_start2(v, l, ...) __builtin_va_start(v, l) + #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #define va_copy(d,s) __builtin_va_copy(d,s) -- 2.34.1