From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 42E071F45A for ; Tue, 25 Oct 2022 18:13:54 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.b="BQvb+qAj"; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onOPg-0004PL-F3; Tue, 25 Oct 2022 14:12:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onOPc-0004Ds-BN for bug-gnulib@gnu.org; Tue, 25 Oct 2022 14:12:30 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onOPa-0007VW-D5 for bug-gnulib@gnu.org; Tue, 25 Oct 2022 14:12:28 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2C5261600B7; Tue, 25 Oct 2022 11:12:24 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PaAXh3eybtUQ; Tue, 25 Oct 2022 11:12:23 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4745E1600AA; Tue, 25 Oct 2022 11:12:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 4745E1600AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1666721543; bh=YGPEaH3WX9ARlfJd/FfbO8nSGOOD2ObTUS1To+TFyts=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type: Content-Transfer-Encoding; b=BQvb+qAj6ySG8kO/ThcYziu506Eguw2ieCWx7FUxb8eMpuZqAs0HVZKi9CE5Chiqs q6nvPTi/N3n6DJyo4vWs5O7KTCTWgsDsqcIaStvz5YtfDOd+ChRSTo7boPiS/GiME1 kiSGb2KHW9dmRl/xL6P0RpzMNwLx3ieDcxSK05Yc= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0dQkDyfA-kyq; Tue, 25 Oct 2022 11:12:23 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 24B351600A5; Tue, 25 Oct 2022 11:12:23 -0700 (PDT) Message-ID: Date: Tue, 25 Oct 2022 11:12:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: Bruno Haible , bug-gnulib@gnu.org References: <34013532.ATrlOLLGV9@nimes> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: assert-h: Make static_assert work on Solaris 11.4 In-Reply-To: <34013532.ATrlOLLGV9@nimes> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "bug-gnulib" Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org On 2022-10-23 07:47, Bruno Haible wrote: > #include > #undef/**/assert > + /* Solaris 11.4 defines static_assert as a macro with 2 arguments. > + We need it also to be invocable with a single argument. */ > + #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus > + #undef static_assert > + #define static_assert _Static_assert > + #endif > #endif]) Will this approach work if code does something like the following? I worry that the later includes would collide with config.h's definition of static_assert. #include #define NDEBUG 1 #include #define NDEBUG 0 #include static_assert (true); Come to think of it, the latest C23 draft is a little squirrelly here, as its section 7.2 says that defines a static_assert macro. This must be a typo because it never goes no to say anything about what the macro does, and static_assert is a keyword in C23. Also, while we're on the topic, why does the latest C23 draft require that when NDEBUG is defined, the assert macro is defined via "#define assert(...) ((void)0)" rather than as "#define assert(ignore) ((void)0)"? What's the point of requiring the ellipsis?