Path: csiph.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan Date: Tue, 11 Apr 2023 04:47:25 -0700 Organization: A noiseless patient Spider Lines: 39 Message-ID: <865ya24p4i.fsf@linuxsc.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: dont-email.me; posting-host="b8523dcffbf3f55a5b42bbad23f83ee0"; logging-data="2748885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186sRaUboifuw+n0nlc6H2593L798SUJYc=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:rFt2l0RDWzQHizkaR3UsnXaAveo= sha1:ZeZRZyaSF5FSFF3R07ecPWu0ubY= Xref: csiph.com comp.lang.c:169969 cross@spitfire.i.gajendra.net (Dan Cross) writes: > In article , jak wrote: > >> Dan Cross ha scritto: >> >>> In article , jak wrote: >>> >>>> Tim Rentsch ha scritto: >>>> >>>>> [snip] >>>>> I agree with the general tone of this suggestion. Unfortunately >>>>> however the particular code suggested might not compile (because >>>>> the macro NULL might be #define'd to be 0, which can result in an >>>>> error). Writing the function this way: >>>>> >>>>> void * >>>>> realloc0( void *p, size_t size ){ >>>>> return size == 0 ? free( p ), p = 0 : realloc( p, size ); >>>>> } >>>>> >>>>> is an easy way to avoid that implementation dependency. >>>> >>>> If you absolutely wanted to avoid dependency, perhaps you shouldn't rely >>>> on autocast and use an explicit one instead. >>> >>> What "dependency" would that avoid, other than a dependency on >>> the C standard? >> >> Why are you asking me this? > > Because you are the one who suggested there is some kind of > "dependency" in Tim's code? I didn't take his comment that way. My impression is that he meant there _might_ be a dependency, or perhaps there is some uncertainty about whether there is a dependency, or possibly that there may be a dependency at some time in the future. Of course I am not sure what he meant, but that is how I took it.