From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 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 B708E1F47C for ; Fri, 13 Jan 2023 22:34:23 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=78364E5A-2AF3-11ED-87FA-8298ECA2D365 header.b=XcYJupWB; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGSce-0008IK-1Y; Fri, 13 Jan 2023 17:34:04 -0500 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 1pGScc-0008Hs-W8 for bug-gnulib@gnu.org; Fri, 13 Jan 2023 17:34:03 -0500 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 1pGSca-0000Nr-Ve for bug-gnulib@gnu.org; Fri, 13 Jan 2023 17:34:02 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4C977160084 for ; Fri, 13 Jan 2023 14:33:59 -0800 (PST) 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 l6yFrJmht4Mb; Fri, 13 Jan 2023 14:33:58 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2C111160081; Fri, 13 Jan 2023 14:33:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 2C111160081 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1673649238; bh=j3As89LGWr318kLCMFHRM017ZWn5yjJlIFVQSGvxTOE=; h=From:To:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding; b=XcYJupWBsjpbOkSOwNjCTOLcK53tMqNrI6Emkf3qZ8/WMDdGqioVdup872cKCJY8n ZrhKttAOaWJIoxzddZx/KS9NwlOuLFlNLOZlk0FpNwS3vndnvXNObjys5BO6fFEgv4 KFvi3PuoaI7w+Ppc1J5eJ5y0XjXcS/oPYyPjdOTs= 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 LzeLmuk5HhNp; Fri, 13 Jan 2023 14:33:58 -0800 (PST) Received: from localhost.localdomain (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0527116007E; Fri, 13 Jan 2023 14:33:58 -0800 (PST) From: Paul Eggert To: bug-gnulib@gnu.org Cc: Paul Eggert Subject: [PATCH 2/2] verify: work around xlclang 16.1 compiler bug Date: Fri, 13 Jan 2023 14:33:53 -0800 Message-Id: <20230113223353.461974-2-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230113223353.461974-1-eggert@cs.ucla.edu> References: <20230113223353.461974-1-eggert@cs.ucla.edu> MIME-Version: 1.0 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 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-bounces+normalperson=yhbt.net@gnu.org Problem reported by Bruno Haible in: https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html * lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE): Define to 0 if compiler advertises itself as clang before version 5. xlclang 16.1 advertises itself as 4.0.1 and this patch works around what appears to be a compiler bug when compiling dfa.c in bleeding-edge grep. --- ChangeLog | 9 +++++++++ lib/verify.h | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3799832c09..dc8fb2c12b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2023-01-13 Paul Eggert =20 + verify: work around xlclang 16.1 compiler bug + Problem reported by Bruno Haible in: + https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html + * lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE): + Define to 0 if compiler advertises itself as clang before version 5. + xlclang 16.1 advertises itself as 4.0.1 and this patch works + around what appears to be a compiler bug when compiling dfa.c in + bleeding-edge grep. + assert-h: suppress xlclang 16.1 false alarms * m4/assert_h.m4 (gl_ASSERT_H): Pacify older clangs too, with regard to single-argument static_assert. diff --git a/lib/verify.h b/lib/verify.h index 17d6e78c81..b63cb26432 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -258,7 +258,9 @@ template =20 /* @assert.h omit start@ */ =20 -#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <=3D __GNUC_PATCHLEVEL__)) +#if defined __clang_major__ && __clang_major__ < 5 +# define _GL_HAS_BUILTIN_TRAP 0 +#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <=3D __GNUC_PATCHLEVEL__)) # define _GL_HAS_BUILTIN_TRAP 1 #elif defined __has_builtin # define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap) @@ -266,7 +268,9 @@ template # define _GL_HAS_BUILTIN_TRAP 0 #endif =20 -#if 4 < __GNUC__ + (5 <=3D __GNUC_MINOR__) +#if defined __clang_major__ && __clang_major__ < 5 +# define _GL_HAS_BUILTIN_UNREACHABLE 0 +#elif 4 < __GNUC__ + (5 <=3D __GNUC_MINOR__) # define _GL_HAS_BUILTIN_UNREACHABLE 1 #elif defined __has_builtin # define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachabl= e) --=20 2.37.2