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=-3.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 424B81F54E for ; Tue, 13 Sep 2022 03:32:37 +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="VOhRO2ru"; dkim-atps=neutral Received: from localhost ([::1]:49488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXwf5-0000BI-U1 for normalperson@yhbt.net; Mon, 12 Sep 2022 23:32:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXwf0-0000Ap-4L for bug-gnulib@gnu.org; Mon, 12 Sep 2022 23:32:30 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXwex-0008Tw-Ex for bug-gnulib@gnu.org; Mon, 12 Sep 2022 23:32:29 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C4A82160073 for ; Mon, 12 Sep 2022 20:32:23 -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 VxGTzeZSSFm7; Mon, 12 Sep 2022 20:32:22 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B2C7316006F; Mon, 12 Sep 2022 20:32:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu B2C7316006F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1663039942; bh=khMyIVnh50zRAN8wjkMPAsnioi42Un3jD8KKLmX8y7k=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=VOhRO2rueIbpE11SFhUYT7rW9ft0JECpbTaFGeSHujHwbPW3tmWi4ND51ps3tEo8J Q/R2cAf6eT3D/11IwSyLCLsY4sqZcU67THEsPZw9CPcsx8Rd2V+IT6hDvBbbYNU4oI XQZIPdIrKt8elXbtYVY6QWhG+fn01n1zaxu9BU20= 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 pjclPb42EzFw; Mon, 12 Sep 2022 20:32:22 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 82418160067; Mon, 12 Sep 2022 20:32:22 -0700 (PDT) From: Paul Eggert To: bug-gnulib@gnu.org Cc: Paul Eggert Subject: [PROPOSED 0/2] static_assert and C23 Date: Mon, 12 Sep 2022 22:32:16 -0500 Message-Id: <20220913033218.1011299-1-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" In the spirit of the recent patches for bool and C23, here's a proposed pair of patches for C23's new keyword static_assert. This uses a similar approach, in that the existing assert-h module, which already provides an that supplies a static_assert macro, is modified to provide something like C23 static_assert even if you don't include . This patchset does differ from the bool patchset in that we can't assume the system supplies a static_assert macro since Gnulib doesn't assume C11. I haven't installed these into Gnulib. Comments welcome. Paul Eggert (2): assert-h: static_assert is a keyword in C23 assert-h: prefer to =E2=80=98verify=E2=80=99 ChangeLog | 65 +++++++ doc/gnulib.texi | 27 ++- doc/posix-headers/assert.texi | 38 ++-- lib/alignalloc.c | 5 +- lib/argmatch.h | 4 +- lib/c32is-impl.h | 3 +- lib/c32snrtombs.c | 4 +- lib/c32srtombs.c | 4 +- lib/exclude.c | 9 +- lib/filevercmp.c | 3 +- lib/fma.c | 5 +- lib/i-ring.h | 3 +- lib/ino-map.c | 3 +- lib/localeinfo.c | 8 +- lib/malloca.c | 3 +- lib/mbrtoc32.c | 3 +- lib/mbrtowc.c | 3 +- lib/mbsinit.c | 3 +- lib/mbsnrtoc32s.c | 4 +- lib/mbsrtoc32s.c | 4 +- lib/nanosleep.c | 3 +- lib/parse-datetime.y | 9 +- lib/pipe2.c | 3 +- lib/rawmemchr.c | 3 +- lib/relocwrapper.c | 3 +- lib/sleep.c | 4 +- lib/stat-w32.c | 3 +- lib/stat.c | 1 - lib/strerror.c | 3 +- lib/strtoimax.c | 6 +- lib/utimecmp.c | 3 +- lib/vasnprintf.c | 11 +- m4/assert_h.m4 | 43 ++++- modules/alignalloc | 2 +- modules/alignof-tests | 3 +- modules/argmatch | 2 +- modules/assert-h | 2 +- modules/assert-h-tests | 3 + modules/c-vasnprintf | 2 +- modules/c32isalnum | 2 +- modules/c32isalpha | 2 +- modules/c32isblank | 2 +- modules/c32iscntrl | 2 +- modules/c32isdigit | 2 +- modules/c32isgraph | 2 +- modules/c32islower | 2 +- modules/c32isprint | 2 +- modules/c32ispunct | 2 +- modules/c32isspace | 2 +- modules/c32isupper | 2 +- modules/c32isxdigit | 2 +- modules/c32snrtombs | 2 +- modules/c32srtombs | 2 +- modules/exclude | 2 +- modules/filevercmp | 2 +- modules/fma | 2 +- modules/fmaf | 2 +- modules/fmal | 2 +- modules/fstat | 2 +- modules/i-ring | 2 +- modules/ino-map | 2 +- modules/intprops-tests | 2 +- modules/libgmp-tests | 2 +- modules/limits-h-tests | 2 +- modules/locale-tests | 2 +- modules/malloca | 2 +- modules/mbrtoc32 | 2 +- modules/mbrtowc | 2 +- modules/mbsinit | 2 +- modules/mbsnrtoc32s | 2 +- modules/mbsrtoc32s | 2 +- modules/nanosleep | 2 +- modules/parse-datetime | 2 +- modules/pipe2 | 2 +- modules/pthread-h-tests | 2 +- modules/rawmemchr | 2 +- modules/relocatable-prog-wrapper | 2 +- modules/round-tests | 2 +- modules/roundf-tests | 2 +- modules/sleep | 2 +- modules/stat | 2 +- modules/stdalign-tests | 2 +- modules/stdckdint-tests | 2 +- modules/stddef-tests | 2 +- modules/stdio-tests | 2 +- modules/stdlib-tests | 2 +- modules/strerror | 2 +- modules/string-tests | 2 +- modules/strtoimax | 2 +- modules/strtoumax | 2 +- modules/sys_stat-tests | 2 +- modules/time-tests | 2 +- modules/uchar-tests | 2 +- modules/unistd-tests | 2 +- modules/unistdio/u16-u16-vasnprintf | 2 +- modules/unistdio/u16-vasnprintf | 2 +- modules/unistdio/u32-u32-vasnprintf | 2 +- modules/unistdio/u32-vasnprintf | 2 +- modules/unistdio/u8-u8-vasnprintf | 2 +- modules/unistdio/u8-vasnprintf | 2 +- modules/unistdio/ulc-vasnprintf | 2 +- modules/utimecmp | 2 +- modules/vasnprintf | 2 +- modules/wchar-tests | 2 +- tests/test-alignof.c | 4 +- tests/test-assert.c | 71 +++++++ tests/test-intprops.c | 3 +- tests/test-libgmp.c | 4 +- tests/test-limits-h.c | 50 +++-- tests/test-locale.c | 4 +- tests/test-pthread.c | 2 - tests/test-round2.c | 4 +- tests/test-stdalign.c | 10 +- tests/test-stddef.c | 43 +++-- tests/test-stdio.c | 4 +- tests/test-stdlib.c | 4 +- tests/test-string.c | 4 +- tests/test-sys_stat.c | 276 ++++++++++++++-------------- tests/test-time.c | 6 +- tests/test-uchar.c | 12 +- tests/test-unistd.c | 4 +- tests/test-wchar.c | 4 +- 122 files changed, 540 insertions(+), 409 deletions(-) create mode 100644 tests/test-assert.c -- 2.37.2