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: Mon, 11 Jul 2016 13:48:58 -0700 Organization: None to speak of Lines: 37 Message-ID: References: <577ba42f.13700328@news.xs4all.nl> <48c43c3f-8e7e-0509-5b9d-04133e7bb537@verizon.net> <57837892.8808984@news.xs4all.nl> <481f30b4-acb3-4445-92b3-c403dc3e51f7@googlegroups.com> <8760sc2aiz.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="26673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OUz19oScS2iJDOqgbxuNn" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:iWAml2mpJTyM2U/geLM7tV6sEQM= sha1:oc2WjoEwaCuTGeQ2HOh2sz0HQOA= Xref: csiph.com comp.lang.c:90231 BartC writes: > On 11/07/2016 21:19, Ben Bacarisse wrote: >> BartC writes: > >>> array = malloc(soezif*sioezf*siozef); >>> array = malloc(szeiof*sizeof*siozef); >>> array = malloc(szeoif*soiezf*sizoef); >>> array = malloc(sozief*soizef*sozeif); >>> array = malloc(sieozf*sizoef*sizoef); >>> array = malloc(szeoif*seizof*sozeif); >> >> Putting aside the absurd example, I'd make two remarks: >> >> 1. In my editor the sizeof is bright blue so it stands out very clearly >> despite your best attempts to hide it. > > (I hope there was only one? I was in a hurry to go out and forgot to check!) > > My point still stands but few are seeing it, that it just looks very odd > that on one line you have A*B*Cm multiplying three names, yet in another > lexically identical line, it means something quite different. I don't think anyone is failing to see your point. We just don't think it's significant. You can write horribly obfuscated code in C, and it's easier in C than in most other languages. So don't do that. [...] -- 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"