From patchwork Tue Sep 7 15:54:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 44895 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 25ADA385740B for ; Tue, 7 Sep 2021 15:54:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25ADA385740B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631030080; bh=a8gOQZ7z4F1SlIMwg3LMQvSeP0/CZCNYI91uQde4pro=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KSt4b4KZrFScbB8+B98LSheMKinI/3qk+7SlS6d1q3UXt2m4oS3zmEuJj6oqC2gpt sHr+DXB88/e90PBUNkY5ZhubgBOJXEQDA5Ou3D2JBdOUIe1kJZfUB7KA/mfasaPTvm SLanT7EbE0F5h7TTUL8VDIaq+sg9LLtNihqc4iGE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id CEB983858D34 for ; Tue, 7 Sep 2021 15:54:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CEB983858D34 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-560-ca77TokFPxuz4tKriEvWsQ-1; Tue, 07 Sep 2021 11:54:15 -0400 X-MC-Unique: ca77TokFPxuz4tKriEvWsQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9B1184A5E5 for ; Tue, 7 Sep 2021 15:54:14 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.195.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F2982C175 for ; Tue, 7 Sep 2021 15:54:13 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] _Static_assert needs two arguments for compatibility with GCC before 9 Date: Tue, 07 Sep 2021 17:54:12 +0200 Message-ID: <87r1e0s7ob.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This macro definition enforces two arguments even with newer compilers that accept the single-argument form, too. Tested on i686-linux-gnu, x86_64-linux-gnu. Built with build-many-glibcs.py. Reviewed-by: Carlos O'Donell --- 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