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=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,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 E2CE81F5A0 for ; Wed, 8 Feb 2023 00:22:19 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=TFZj8dsK; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPYDp-0006R6-3k; Tue, 07 Feb 2023 19:22:01 -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 1pPYDn-0006Qr-Ks for bug-gnulib@gnu.org; Tue, 07 Feb 2023 19:21:59 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPYDl-0002Kb-9u for bug-gnulib@gnu.org; Tue, 07 Feb 2023 19:21:59 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1675815703; cv=none; d=strato.com; s=strato-dkim-0002; b=FRUFNBsW9iDG2JON2tkDJTGjZ7UyPUrLdgm2AVMc7rv4Ie+7Ko1G2iHuM+EPuPTmev RPDtLJ9A+e6pojE0QgJkAlpepbl3RHv5lmywh2Dyc3oUo6PoY3wEgfpAf+ejOlzIU60k mQ+86DNC74WWCPuJmmKp5IRcj/uCGBa/4RqpmyV/6dFvRyN6nLNWVWYcMkue+m2326To ZQtjyo27Inj69X2Oqhpukz8vW+Bz9qCq3R+u9EQXW0d3ZLLSYeCCMdvFKw3LKMQokoZn qXYw2NL9pgcOKDjURC6F0Vf9v9Dx71ahl1jAXz9ALkychugQgUr/sKYYz+o732vNlZuL wcSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1675815703; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=NP1lvuurCEmG4w3+mRq1WR1fshTq51n9oFWH7BPzb3g=; b=mBgmrbWuEzVg7l97YysPPvUtap+oKqxrlyCan+w6bTutlReuaEoQiQSNIDEvqkCbQi GvBUV/7FYJb5KO0TcN+wmDMGrJo6/cKv5nZCOa4cD5OQ+vyFlRjk6Yd1eTlLFAfp4qBX bBbpO/zSgIRqF6crL/0Id3zic71F676o+K2jGix/kPB1JsDMLLJVBxJUMhrGCfdKY8+b IU5OhtqQYNo0V/Cm5wcdvIQvSgdYOxeZPtInaxi4ISxFMuEntu5wAJJnefPBN4rMKoc3 RSDhxp/E11lXPS+rqI/sHOYp+ZHCMkSYj5fmstcr1XJFLIn7hO0EBGXFqY+f+MYOv+hq xVng== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1675815703; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=NP1lvuurCEmG4w3+mRq1WR1fshTq51n9oFWH7BPzb3g=; b=TFZj8dsKPm0LSxQd9y2NIhh5T1NHonLEOHNE9CB2zDuX+m+LtdHEKXwrAWtE7EuNxr WuRN1ocPTzfVJ7Cyy1UiBQmOlf+9BhSot97U5W+jbk4oy72c+9ZPnj/bkfMLqRRYrfh7 Dvxo+garSXiO8Y8xDL0FfQrKPPr62C+RC5ImlDHtJBD5xgUK4q1C9eqc7xOTMVEJs0ke DGJiUpMjbV0nn3fIKpeLjsJaH7SMXoPUhh8oy6HX3/z8W9Gz6jEWd5nk4I27xGqH83M4 /oWAYgdWJodzUmcbK5q7z9sLd8Cyo8OZYg39IptVIJLz7qxHHQ3KuATJkgePMyIpCrQz nwTA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOT3Pf3uuFFBtaxzk2sKhQlmEEvrw==" Received: from nimes.localnet by smtp.strato.de (RZmta 49.3.0 AUTH) with ESMTPSA id f83259z180Lh5KZ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 8 Feb 2023 01:21:43 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Cc: Bjarni Ingi Gislason Subject: Re: -funsigned-char Date: Wed, 08 Feb 2023 01:21:43 +0100 Message-ID: <3741171.Sf62SLZxhT@nimes> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.53; envelope-from=bruno@clisp.org; helo=mo4-p01-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, 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.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 Bjarni Ingi Gislason wrote: > > ../../gnulib-tests/test-localeconv.c:53: assertion 'l->frac_digits == CHAR_MAX' failed > > FAIL test-localeconv (exit status: 134) > > > > l->frac_digits is 127 and CHAR_MAX is 255. > > This is due to the CFLAG "-funsigned-char" When you connect a libc compiled for one ABI and a program compiled for a different ABI (that's what -funsigned-char produces), you evidently get breakage. > which I always use having > compiled "less", which produced a lot of warnings without this flag. The way to fix the problems occurring because a program wants to view their strings as 'unsigned char *' is - NOT to use -funsigned-char, as you just have seen, - NOT to cast pointers from 'char *' to 'unsigned char *' and vice versa, because ultimately this leads to strict aliasing violations in some places, - BUT to cast individual 'char *' elements to 'unsigned char' right after fetching them from the string. E.g. if (isalnum ((unsigned char) *p)) Bruno