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.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 8C6C61F8C6 for ; Sun, 20 Jun 2021 01:19:00 +0000 (UTC) Received: from localhost ([::1]:56866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lum71-0004kZ-8v for normalperson@yhbt.net; Sat, 19 Jun 2021 21:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lum6y-0004kN-HV for bug-gnulib@gnu.org; Sat, 19 Jun 2021 21:18:56 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.24]:28194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lum6w-0006cu-7j for bug-gnulib@gnu.org; Sat, 19 Jun 2021 21:18:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1624151931; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=Rpo1ZYZ3vSXk0ntwlskMR0/XkPcKKXs8LDTrWK3WdEg=; b=Oy1suTtXl+nfWnabsm2i5V8wu4OFDmzVwXMsyeaJ0pRgzEmT3h6jsBaUwJ+fhhJp0c rtiHObNFL8jrdZNMvSp0GCaNngdBBuXwAjWI2EKiO13VHXuk/Q7xMmg1YP/Fy+uWj8X/ 2oKw7x9YzvgJtGF1CEh630Wrby9rYs/+I8b/Z075yXqeplZqPz1oDEeyMIV55pZDKL0Z P6IADR4dNotzhOmFqk2980KZESD45D3K8longRpKfAZEwQtx1H5kyYgMbt9J96Ecgps4 nvw5O7jbrRthwGRJ1OUUz3xcBClF9Dlc1rx0jD3Xy1Xk4c3OTXJ3eQjkkuY6VICjO6dJ VIkA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGKf9yfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.27.3 DYNA|AUTH) with ESMTPSA id 401b97x5K1Ip83L (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 20 Jun 2021 03:18:51 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: unitypes: Fix trouble caused by installed older versions of unitypes.h Date: Sun, 20 Jun 2021 03:18:50 +0200 Message-ID: <10759128.r2Ti8XXdCi@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.24; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 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" When building code that using unistr.h, which depends on unitypes.h, on a machine that has an older libunistring installed, I get these compilation errors: "../gnulib-lib/unistr.h", line 377.38: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 379.40: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 381.40: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 532.41: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 534.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 536.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 541.41: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 543.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 545.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 550.42: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 552.44: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 554.44: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 560.42: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 562.44: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 564.44: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 569.41: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 571.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 573.43: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 578.42: 1506-275 (S) Unexpected text dest encountered. "../gnulib-lib/unistr.h", line 580.44: 1506-275 (S) Unexpected text dest encountered. The cause is that uniname.h has been included from the install location, which included "unitypes.h" also from the install location. So, the unitypes.h file in the build directory was ignored. It is hard to come up with a general fix of this; but this workaround fixes the issue. 2021-06-19 Bruno Haible unitypes: Fix trouble caused by installed older versions of unitypes.h. * modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h. diff --git a/modules/unitypes b/modules/unitypes index 8d3ccf0..46ed80d 100644 --- a/modules/unitypes +++ b/modules/unitypes @@ -11,6 +11,22 @@ stdint configure.ac: gl_LIBUNISTRING_LIBHEADER([0.9.11], [unitypes.h]) +AH_VERBATIM([unitypes_restrict], [ +/* This definition is a duplicate of the one in unitypes.h. + It is here so that we can cope with an older version of unitypes.h + that does not contain this definition and that is pre-installed among + the public header files. */ +# if defined __restrict \ + || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ + || __clang_major__ >= 3 +# define _UC_RESTRICT __restrict +# elif 199901L <= __STDC_VERSION__ || defined restrict +# define _UC_RESTRICT restrict +# else +# define _UC_RESTRICT +# endif +]) + Makefile.am: BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)