Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: question about nullptr
Date: Wed, 10 Jul 2024 07:51:58 -0700
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <86msmp8fld.fsf@linuxsc.com>
References: <20240706054641.175@kylheku.com> <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> <86le2b9ru6.fsf@linuxsc.com> <8734ojxlg7.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 10 Jul 2024 16:51:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="47644514c0c8b52a7b182738a8527a90";
logging-data="2055199"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Nwa7iFF0marmAf+N+DpcTpDJtRw4ZNBQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Fiqlfu8CtDjchvr/Oh5HSWJqLPs=
sha1:tIhv4UWvpsbzGXKJk073Jxyjg/o=
Bytes: 1857
Keith Thompson writes:
> Tim Rentsch writes:
> [...]
>
>> This posting has inspired me to try using (long)0.0
>> whenever a null pointer constant is needed. As for
>> example
>>
>> (void*){ (long)0.0 }
>>
>> as an argument to a variadic function where a pointer
>> is expected.
>
> But surely ((void*)('/'/'/'-'/'/'/')) is more elegant.
Surely not. Furthermore the form I showed has a point,
whereas this example is roughly the equivalent of a
first grade knock-knock joke.