Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: double free Date: Sat, 09 Jul 2016 14:24:37 -0700 Organization: None to speak of Lines: 22 Message-ID: References: <577ba42f.13700328@news.xs4all.nl> <48c43c3f-8e7e-0509-5b9d-04133e7bb537@verizon.net> <1ad2ad44-a44e-adee-2b4e-8a4c80a881d9@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="18556"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0bfg1UBY+1MLLsNwNunv1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:3tKmt0z4OkhLvCQ5r1raJs/Dm8A= sha1:IyvCEusnVc+YD8PZeXJwva63eLQ= Xref: csiph.com comp.lang.c:90161 "James R. Kuyper" writes: > On 07/09/2016 05:10 PM, Keith Thompson wrote: >> jameskuyper@verizon.net writes: > ... >>> and the cast causes an utterly unnecessary and useless error message >>> if you add it to what is otherwise the preferred way of handling the >>> call: >>> >>> p = (double*) malloc( sizeof *p); >> >> I presume you didn't intend to use a cast there. > > Actually, I did - that code was intended to be an example of what should > NOT be done, and why. "otherwise". Got it. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"