Path: csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Wed, 20 Jul 2016 17:21:54 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: A glitch regarding the usual malloc() idiom References: <4cd22745-22ad-4ac7-bdba-39ffa1c75e13@googlegroups.com> <7d995799-5f23-4784-a62e-ea423de00650@googlegroups.com> <87k2gg2j8c.fsf@gmail.com> Date: Wed, 20 Jul 2016 23:21:54 +0100 Message-ID: <87k2ggkl19.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:ZI1DNhK1NBjzzJDhYITI+MPb3v4= MIME-Version: 1.0 Content-Type: text/plain Lines: 25 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-ZIrsQDRouBRIyohZFVJbwFwXzuy85hlnpXrYsRtIPQ+v8o+ovtbrrM5ZcJ2TO1k+drDASWKKMGaJ8tR!1vRKLTqJRu8qaRImRHfluTqKLvoDGRRrELJ6Q3gnebjCdsDY6FOCIvYDJmUAhq5mbd8= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2092 Xref: csiph.com comp.lang.c:90701 Keith Thompson writes: > Gareth Owen writes: >> Richard Heathfield writes: >>>> It's the double abstraction problem >>>> >>>> magptr = malloc(40 * sizeof(float)); >>>> >>>> tells us that we are asking for 160 bytes of memory. >>> >>> No, it doesn't. It tells us we're asking for 40 * sizeof(float) bytes >>> of memory. >> >> Supremely confident idiot. > > Gareth, you're not helping. Well, if you keep treating Malcolm's ridiculous rules, ground less assertions and self-serving ever-mutating redefinitions of standard terms as the starting point for debate (and bear in mind he never never never admits that his rules are anything other than totally correct) well ... you're not helping either. At least I have brevity on my side.