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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.74.5 with SMTP id k5mr6279877itb.30.1516849629262; Wed, 24 Jan 2018 19:07:09 -0800 (PST) X-Received: by 10.157.85.15 with SMTP id l15mr777878oth.12.1516849629155; Wed, 24 Jan 2018 19:07:09 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w142no352307ita.0!news-out.google.com!s63ni4625itb.0!nntp.google.com!w142no352302ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Jan 2018 19:07:08 -0800 (PST) In-Reply-To: <13db4b37-ac2d-497d-b7eb-f2d93462f480@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:7466:f44c:da21:40b1; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:7466:f44c:da21:40b1 References: <3d796e5f-015e-469c-bbcb-edc3303793ab@googlegroups.com> <21d0a0b8-8c66-42fb-9d4a-dc9dbbc33521@googlegroups.com> <0829e4c2-ea35-4a87-b5b4-330093ac739c@googlegroups.com> <13db4b37-ac2d-497d-b7eb-f2d93462f480@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <43bc9f67-1a10-42c6-b04d-79a7731408b4@googlegroups.com> Subject: Re: no + or - defined for fixed point types in Standard, why ? From: Robert Eachus Injection-Date: Thu, 25 Jan 2018 03:07:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 257957589 X-Received-Bytes: 3460 Xref: reader02.eternal-september.org comp.lang.ada:50133 Date: 2018-01-24T19:07:08-08:00 List-Id: On Wednesday, January 24, 2018 at 8:31:33 PM UTC-5, guyclaud...@gmail.com w= rote: > > As I said, you can turn off warnings if it bothers you. I think if you= look through the GNAT sources, there are a number of places where they do = that. As a programming practice, I like it. It says that the programmer k= nows that the compiler won't like this, but I want to do it anyway. >=20 > I wouldn't have thought reading that from an Ada user 0_0 > I don't think I'm nearly as wise as people who wrote the compiler. Even i= f I had been a qualifier programmer, I would think the same and abide by th= e conventions as much as I could. I'm too conservative in general to go aga= inst habits without due reasons or ways to do otherwise. >=20 > > function Test is > > begin if false then return; end if; end Test; > > >=20 > it says the first line lacks a "return" statement, which even I can see..= . why writing such a thing ? Looks like a piece of C, with its void functio= n, or whatever they call that. It's raising hairs on my shoulder, really. function Test return Integer is begin if false then return 6; end if; end Test; Oops! wrong test case, try this: function Test3 return Integer is begin if false then return 6; end if; end Test3; You should get at least one warning, and no errors. Provide a Boolean para= meter instead of false: function Test4 (X: Boolean) return Integer is begin if X then return 6; end if; end Test4; And you should be down to one warning. Compiler writers have thousands of these ugly things and sometimes what the= compiler guesses you intended is good for a laugh. Some test cases are re= gression tests collected from bug reports--you never want to reintroduce an= old bug. Others are designed to thoroughly test all the ways you imagine = that a new feature can get misused.=20