Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Wed, 10 Jul 2024 14:23:06 -0700 Organization: None to speak of Lines: 28 Message-ID: <87cynluekl.fsf@nosuchdomain.example.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> <86msmp8fld.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 10 Jul 2024 23:23:07 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2ff96a67704e58776cf4f9c1dffac965"; logging-data="2150127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2IpTXbiQs98jtocyF3QzC" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:WEHMoCPE0I9FSEhIcd0epAbOZUY= sha1:axz8r6q2uRAWPE0VDvi/J7BiMjQ= Xref: csiph.com comp.lang.c:387019 Tim Rentsch writes: > 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. I was of course joking. I assumed you were as well. What is the point of (void*){ (long)0.0 }? I don't believe it's a null pointer constant even in C23. My example is. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */