From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 3A58D3857C61; Wed, 5 May 2021 19:57:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3A58D3857C61 Received: by mail-wm1-x329.google.com with SMTP id b11-20020a7bc24b0000b0290148da0694ffso4085029wmj.2; Wed, 05 May 2021 12:57:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=f5JJemzqcPZxarErKVy2+degi+rDU2JWemhOD0oLEVQ=; b=Tn4eadydTshjMir1OetBLKjfINb2hn+1ONla99wvChUJv2n/37n4VYR9DlJUFShSoo 2jkcIVZTZck12urObafRs+UjB/NFnwEYJ+TU+f9ZKTflW9XgMX/18vSNshczgfKX+yqN dseS4wHJ9Vi9j5s0ZL2gkZSaotphUJxOp4ENOCuoLvf46kB5ftQB1FiFhPSlz+vKCBVV 0ldIzWDI9XWEqYv8GJl7lOEGRWGbSxbAvQH+5FTjRO4GYo6nrZpeP9RIxegroJdoUxJV neNQdbzA1OWRFhd4avpEGlES6yq0xBDHVdja/+gPQc2PlZ5krTarsL4mvDIvR9XkHTL2 3+pQ== X-Gm-Message-State: AOAM5302bdND9dJ6j/sEZ4mLW3qafb79gnwfjTGJ+HLbamCAA/myJhKg J+yPdqlo4x2SuS606CPoKb4W2Qpguc815A== X-Google-Smtp-Source: ABdhPJxvsXqW4sbnCs1RjzpOEParEiITojI6j9lSaPZ2+6FE5ttgjOsb6d4p+gAjmZAX9ibDtoM6Sw== X-Received: by 2002:a1c:dd46:: with SMTP id u67mr435375wmg.73.1620244677113; Wed, 05 May 2021 12:57:57 -0700 (PDT) Received: from ?IPv6:2a01:e0a:1dc:b1c0:594d:15cc:8509:a899? ([2a01:e0a:1dc:b1c0:594d:15cc:8509:a899]) by smtp.googlemail.com with ESMTPSA id e10sm427456wrw.20.2021.05.05.12.57.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 12:57:56 -0700 (PDT) Subject: Re: [committed] libstdc++: Use unsigned char argument to std::isdigit To: Jonathan Wakely , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org References: From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Message-ID: <7637b4da-9fcf-c653-ba35-be1e449ec54b@gmail.com> Date: Wed, 5 May 2021 21:57:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2021 19:57:59 -0000 On 05/05/21 2:01 pm, Jonathan Wakely via Libstdc++ wrote: > Passing plain char to isdigit is undefined if the value is negative. > > libstdc++-v3/ChangeLog: > > * include/std/charconv (__from_chars_alnum): Pass unsigned > char to std::isdigit. > > Tested powerpc64le-linux. Committed to trunk. >        unsigned char __c = *__first; -      if (std::isdigit(__c)) +      if (std::isdigit(static_cast(__c))) I am very curious to know what this static_cast does on __c which is already unsigned char ? If it does I'll just start to hate C++ :-) Maybe you wanted to put it on the previous *__first ?