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.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 69A621F45A for ; Tue, 25 Oct 2022 18:20:11 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V5w6n6pt"; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onOWB-0002aw-Gi; Tue, 25 Oct 2022 14:19:15 -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 1onOW4-0002Qm-FX for bug-gnulib@gnu.org; Tue, 25 Oct 2022 14:19:10 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onOW2-0000BM-Oy for bug-gnulib@gnu.org; Tue, 25 Oct 2022 14:19:08 -0400 Received: by mail-pg1-x52e.google.com with SMTP id s196so12287156pgs.3 for ; Tue, 25 Oct 2022 11:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uSX6+wnggBbfxi47ct9IKo1LmvkUX/Jyf1T1hRHy7Dc=; b=V5w6n6ptQKDI/lZyMENLob4xqgV3sy6q0/oH/N03V8UyoZr/wUnuTes6ITeg8Xc/+V KzXqA6pM6D5M9So4EIB8nxOLfbNW7bjNqgp1NRCFcL/CT9D0dp1W/nqL0qbOz3VRh/mc bQed+pjVpxkBRHaS9CNgzp9xYcjxwSDtOkCJzbvRabqSDeBzVL20gruQAWIXLa4VXr6J dIU2ICLsYgPveL4jsuOC+yd2O5LhShfQ/tIi4ryYmajPspdNBUg1dEI6gAHBLtcS6+dP +FS8H70AF9v0jj6BV0KuudXszhECwmdavC23SWgTWEoO+6D51gZEaeJgSUEmzpT4o01R e22A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uSX6+wnggBbfxi47ct9IKo1LmvkUX/Jyf1T1hRHy7Dc=; b=gYTNfZ+/pPdej+hni2X3tXkU/mINQXm0IR5lqjDo/JzKFKaXUtlueJB3TF6dvgEoX2 v1BDPc/u20uK0Z1gXk2/7re6yEQmjVMnH+/+XwL9if3zW75z6OBCvtozrdahYlISHtDy BXbYO0Rasx10+4KZMrfiVgOK42QNoniSQ0YRx/lcvnD+yaczSYnpD1G11/DU3vR/vmmh uZkIwPEJNegMmD7gmJGWY46zDwQszVFNQqWRUlKqV8AsgFOPAidpXbbpRiTcsQflZKmi 6Kdgv7R2OPUlFgCAiNv7/1fvxIv8kkJS4c0H4UGB9l0wCojEKxpGCw87WcHzDnjmwhng WEUg== X-Gm-Message-State: ACrzQf1EuVhpsD8Ggqr2HSm0Yjs8OK8RFeUdglZxeSxr7qJ9RAg5ZIRV PmnD7wefbaRavVU2Giro8mnXrQfxz5bYxcO7S34= X-Google-Smtp-Source: AMsMyM7sb8fwOmK2/XE1FojPTqI/fe3Q7R/7kqiZQmqTsrDn9z1Y1A2e1cHwYsSPfFrO0z31GigM1zAlpQlzSARuLEY= X-Received: by 2002:a05:6a00:b8d:b0:56c:394d:7d33 with SMTP id g13-20020a056a000b8d00b0056c394d7d33mr2212268pfj.86.1666721944909; Tue, 25 Oct 2022 11:19:04 -0700 (PDT) MIME-Version: 1.0 References: <34013532.ATrlOLLGV9@nimes> In-Reply-To: From: Jeffrey Walton Date: Tue, 25 Oct 2022 14:18:52 -0400 Message-ID: Subject: Re: assert-h: Make static_assert work on Solaris 11.4 To: Paul Eggert Cc: Bruno Haible , bug-gnulib@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=noloader@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Reply-To: noloader@gmail.com Sender: "bug-gnulib" Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org On Tue, Oct 25, 2022 at 2:13 PM Paul Eggert wrote: > > 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? Re: the ellipses. From https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2264r3.html, Section 8: These changes are relative to N2573. If those changes are applied the minimal change for C++ standard proposed above could be used. In section 7.2 (Diagnostics ) change the definition of the assert() macro to use elipsis instead of a single macro parameter: ... Jeff