From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D21922F32 for ; Fri, 5 Jul 2024 16:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720197144; cv=none; b=oowkEZseW92Y/6Z+VXl6F2sz6/PstKBoM+JEYrWIrC1ya/CLZvon4Aiqhcd6gO5TGa5EsV1BrlJcycasc9LdZxj8HNpyG6Le9rjlli+Ilsd29DQJJqbbJxc6KxF0LJbgpEBhJvakfOpFL7WyKnW/9TTBFTO0SqxEk/5cHkkNUXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720197144; c=relaxed/simple; bh=mcbhW/bQesNwO+ga/OFvwY4t1KYujGOGY9qvwCh4dGU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=MiJr+7XQf0B5UP71z1Mi/6VIpReNdWii1junsqawuzNVAOiJAJmxrWvJjRifWrnjlOBlWYBOcVeNmNMHbqd5kLxpC1JXqyeRO4ZJFX4KsBIguvN0kC9PVhA8Hks3+N5LlI+zB5Fd85bUoUr34sZMePvz/g0KCfhjxs+yXZ9dlP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org From: Sam James To: Jonathan Wakely via Gcc Cc: Xi Ruoyao , Jonathan Wakely , Alejandro Colomar , Martin Uecker , Jakub Jelinek , libc-alpha@sourceware.org, Paul Eggert , linux-man@vger.kernel.org Subject: Re: [PATCH v1] Remove 'restrict' from 'nptr' in strtol(3)-like functions In-Reply-To: (Jonathan Wakely via Gcc's message of "Fri, 5 Jul 2024 17:24:41 +0100") Organization: Gentoo References: <20240705130249.14116-2-alx@kernel.org> <38982a470643f766747b0ca06b27ca859a87b101.camel@xry111.site> <08bc01290aca2408f69a6df2088eed7697968e90.camel@gwdg.de> Date: Fri, 05 Jul 2024 17:32:16 +0100 Message-ID: <87jzhz241b.fsf@gentoo.org> Precedence: bulk X-Mailing-List: linux-man@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jonathan Wakely via Gcc writes: > On Fri, 5 Jul 2024 at 17:02, Xi Ruoyao via Gcc wrote: >> >> On Fri, 2024-07-05 at 17:53 +0200, Alejandro Colomar wrote: >> > At least, I hope there's consensus that while current GCC doesn't warn >> > about this, ideally it should, which means it should warn for valid uses >> > of strtol(3), which means strtol(3) should be fixed, in all of ISO, >> > POSIX, and glibc. >> >> It **shouldn't**. strtol will only violate restrict if it's wrongly >> implemented, or something dumb is done like "strtol((const char*) &p, >> &p, 0)". >> >> See my previous reply. > > Right, is there a valid use of strtol where a warning would be justified? > > Showing that you can contrive a case where a const char* restrict and > char** restrict can alias doesn't mean there's a problem with strtol. I still don't understand why it'd be appropriate for GCC and glibc to override this without it even being *brought to* the committee, either.