From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Wed, 09 Feb 2011 22:42:05 +0100 Message-ID: References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> <1f229967-d3cf-42b6-8087-c97ee08652f3@i40g2000yqh.googlegroups.com> <4d5110ea$0$7669$9b4e6d93@newsspool1.arcor-online.net> <1fb3ce45-ffcc-4c1c-8f76-d151975c8425@x1g2000yqb.googlegroups.com> <4d511500$0$7665$9b4e6d93@newsspool1.arcor-online.net> <4d518a90$0$7651$9b4e6d93@newsspool1.arcor-online.net> <4d51b471$0$6772$9b4e6d93@newsspool3.arcor-online.net> <1lajq4dvy7368.41bre951qpy3$.dlg@40tude.net> <6r07nah77nc1$.uwqkyjfg484k$.dlg@40tude.net> <4d5302df$0$18057$882e7ee2@usenet-news.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net kCW175Y+2YzWs/ckKa7SgQH/e6uyN39wxgKOSW8nLrg/gsFzFJ Cancel-Lock: sha1:SoLnqYCLfqusq3wOwFSWB4BpUKU= User-Agent: Opera Mail/11.01 (Win32) Xref: g2news1.google.com comp.lang.ada:17168 Date: 2011-02-09T22:42:05+01:00 List-Id: Hyman Rosen wrote: > On 2/9/2011 3:19 PM, Vinzent Hoefler wrote: >> So it probably was as readable as C-code could ever be. Of course, things like >> putting "(void)" before each function where the return value is not evaluated >> might not really count as "readable", but it's a good hint for the maintenance >> programmer that it was ignored on purpose. > > Ugh. I would never allow such constructs to pass inspection. > It isn't idiomatic C, and it's ugly as sin. AFAICT, it's a common coding standard in the automotive industry. Probably based on MISRA, rule 86: "If a function returns error information, then that error information should be tested." There also was the rule that every "if" needs an "else", even if empty. > Why might you have such ignored returns? Because one does not fscking care about whatever bogus result the function is returning? ;) > If you write > > (void)strcpy(buf, "hello"); > > that doesn't tell me you're careful, I'll just hate you. Don't hate me, hate the coding standard that tells you to do (void) printf ("Hello, world."); Or when was it the last time, that you evaluated the return code of printf()? Or close()? Vinzent. -- You know, we're sitting on four million pounds of fuel, one nuclear weapon, and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it? -- Rockhound, "Armageddon"