From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 54A663851898; Tue, 29 Nov 2022 09:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54A663851898 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669712661; bh=vDukrDcey3Zh/9LXgfIVYe3Q93B9hDXcWZyA3ZQWQSY=; h=From:To:Subject:Date:From; b=a4B/N/bTNd5vKgwS5i42im5EOLxm6omt1JMQEZyzd2h2geW93jM0wBGOj+CF/ftSl tRaL9Bnvkqg/lX2yr/xlRNmyXED8UaC725KzRmDDzTl4z4iSewGKuavVqbkq8FdzcF /hjs9n5EsxAVa6Wth13DA/BA7jN2Vh7lDgofWEyc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.34/master] _Static_assert needs two arguments for compatibility with GCC before 9 X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/release/2.34/master X-Git-Oldrev: 405b8ae13540e9fd614df614e3361ebf9abd14cf X-Git-Newrev: a1c12fdf3f9b8665719835ce8330b3b2e2574b37 Message-Id: <20221129090421.54A663851898@sourceware.org> Date: Tue, 29 Nov 2022 09:04:21 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a1c12fdf3f9b8665719835ce8330b3b2e2574b37 commit a1c12fdf3f9b8665719835ce8330b3b2e2574b37 Author: Florian Weimer Date: Fri Sep 10 13:18:36 2021 +0200 _Static_assert needs two arguments for compatibility with GCC before 9 This macro definition enforces two arguments even with newer compilers that accept the single-argument form, too. Reviewed-by: Carlos O'Donell (cherry picked from commit c9fef4b7d1d0f2dad192c74f06102752247677a9) Diff: --- include/sys/cdefs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 6a76160ed4..56adb231aa 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -1,5 +1,12 @@ #ifndef _SYS_CDEFS_H +/* This is outside of _ISOMAC to enforce that _Static_assert always + uses the two-argument form. This can be removed once the minimum + GCC version used to compile glibc is GCC 9.1. */ +#ifndef __cplusplus +# define _Static_assert(expr, diagnostic) _Static_assert (expr, diagnostic) +#endif + #include #ifndef _ISOMAC