Deutsch   English   Français   Italiano  
<86zfqq8dmg.fsf@linuxsc.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: question about nullptr
Date: Tue, 09 Jul 2024 14:22:15 -0700
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <86zfqq8dmg.fsf@linuxsc.com>
References: <v6bavg$3pu5i$1@dont-email.me> <20240706054641.175@kylheku.com> <v6bfi1$3qn4u$1@dont-email.me> <l9ciO.7$cr5e.2@fx05.iad> <877cdyuq0f.fsf@bsb.me.uk> <2ckiO.19403$7Ej.4487@fx46.iad> <87plrpt4du.fsf@bsb.me.uk> <9bCiO.7108$sXW9.3805@fx41.iad> <877cdwu9s1.fsf@nosuchdomain.example.com> <20240708222804.00001654@yahoo.com> <v6hotk$11nib$2@dont-email.me> <20240709104848.00005732@yahoo.com> <86cynmajh9.fsf@linuxsc.com> <v6j9ce$1bvoj$1@dont-email.me> <864j8yaa8u.fsf@linuxsc.com> <v6jnom$1en73$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Tue, 09 Jul 2024 23:22:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4404f50b61bba69374b6468dfb9554fc";
	logging-data="1623985"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/RVaeOHy/7bcaGU5Ms4jGLb19Axw254II="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:U/xeL7eVBNWU8p/gPz//je78SKI=
	sha1:AftJfgGoYDgvkForGMgv7CqcQDI=
Bytes: 2516

Thiago Adams <thiago.adams@gmail.com> writes:

> On 09/07/2024 11:52, Tim Rentsch wrote:
>
>> Thiago Adams <thiago.adams@gmail.com> writes:
>>
>>> On 09/07/2024 08:32, Tim Rentsch wrote:
>>>
>>>> Any use of '\0' almost always strikes me as an affectation.  It's
>>>> like people want to somehow pretend that it's not the same as
>>>> just 0.
>>>
>>> I like to pretend
>>>
>>> '\0'   is not int
>>> 2 > 1  is not int
>>> etc
>>>
>>> I know it is int, but I think this needs a redesign in C.
>>
>> I strongly encourage you not to do that.  Based on past
>> experience most of your ideas for improvements make
>> things worse rather than better.
>
> It is only for static analysis.
>
> For instance:
>
>
> enum  E {Z = 0};
>
> int main()
> {
>   int * p;
>   p = '\0';
>   p = false;
>   p = Z;
> }
>
> clang has 3 warnings for this code.
>
> https://godbolt.org/z/56fn5PT4h
>
> Especially for p = Z and p = '\0' we have value 0 of type int, but the
> compiler is not blind for the other characteristics.

You could give a master class in missing the point.