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!news4.google.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 21:19:44 +0100 Message-ID: References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <4d4ff70e$0$6886$9b4e6d93@newsspool2.arcor-online.net> <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net KSJLTe5HAHsUW6EnGCZxWwD7wrMnuCdJ75xnpSTp5wHh23TY6S Cancel-Lock: sha1:0T3OlvgbgKJpP/GH5RZvMIAgpYM= User-Agent: Opera Mail/11.01 (Win32) Xref: g2news1.google.com comp.lang.ada:17148 Date: 2011-02-09T21:19:44+01:00 List-Id: Dmitry A. Kazakov wrote: > On Wed, 09 Feb 2011 19:25:16 +0100, Vinzent Hoefler wrote: > >> Dmitry A. Kazakov wrote: >> >>> Unfortunately not. The problem is that the C language was not designed in >>> order to be used at this level of scrutiny. It becomes extremely annoying >>> because many warnings are false negatives. It is a structural problem of C: >>> the number of false negatives cannot be reduced without increasing the >>> number of false positives. And this is not the compiler's problem only. >>> When you read C program you have to set your alarm level much lower than >>> for Ada. Because otherwise, you won't be able to understand the program at >>> all. >> >> So tell me what I did wrong. In the eight months I spent in the auto-motive >> sector [so I literally moved up ;)] I did MISRA-C, both compilers were tuned >> to their maximum warning level and PC-Lint was run with a quite restrictive >> set of rules. The goal was zero warnings from those tools. I think, I had >> two which could not be circumvented and thus could count as false-positives. > > You circumvented false alarm rather than fixed actual problems. I wouldn't see it that way. Most warnings were actual defects (not necessarily bugs in the common sense, but at least "questionable constructs" like using an "int" where it should have been the appropriate typedef), some warnings even turned out to be real bugs. But well, with GNAT I also usually turn on most style-checks, even the real masochistic ones, so my point of view in that matter is probably skewed. > Did it make the program more readable? Well it went through all code reviews with only minor objections (like "for the ASM-function doing the RAM-check every single line shall have a comment"). 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. 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"