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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27348 invoked from network); 31 May 2023 09:25:18 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 09:25:18 -0000 Received: (qmail 1671 invoked by uid 550); 31 May 2023 09:23:42 -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 1213 invoked from network); 31 May 2023 09:23:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=NalKLBIddixxS211k6ojPsurcTqOY8/sJ4Xcah63VHQ=; b=RhC9DpZjDxmD2HBqG/a3m8MH7grWFCkC+wS2YLsc7tTDpisasuxcuYN6 RHAmnCxZ7HVRAuJ3NnDVyYJD4gxoU7jK7aRzNLC8mnbVPMH23adPBlnGh JnccNMgJFq1I3ZboyWgfwptLNGQ6tn50EOLbG5mZA0K8ko+EZeLUsjxl9 k=; 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,205,1681164000"; d="scan'208";a="57428757" From: Jens Gustedt To: musl@lists.openwall.com Date: Wed, 31 May 2023 11:23:01 +0200 Message-Id: <57b76f7276b3aacb71d91e08af12b705630e947b.1685522953.git.Jens.Gustedt@inria.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. --- 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