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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Best representation for spares Date: Sun, 16 Feb 2014 09:25:35 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <215f6df2-a7ec-42f4-ac82-656d5b12bf61@googlegroups.com> <8383f5d6-3f66-415b-ab3f-8801fa377a6b@googlegroups.com> <8200939f-9bbd-44dd-848c-00c663f37121@googlegroups.com> <1e41e2d6-7ff8-445d-9c14-14c49b244bcf@googlegroups.com> <06585673-8016-43fd-ba97-871192b88917@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1392560739 28741 192.74.137.71 (16 Feb 2014 14:25:39 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 16 Feb 2014 14:25:39 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:h9fpJYUUuvemF3v/ctIA/JDWW8g= X-Original-Bytes: 2203 Xref: number.nntp.dca.giganews.com comp.lang.ada:184914 Date: 2014-02-16T09:25:35-05:00 List-Id: "Rego, P." writes: > On Sunday, February 16, 2014 9:10:11 AM UTC-3, Simon Wright wrote: >> With GNAT, you could put pragma Warnings (Off) just before the >> statement, and pragma Warnings (On) just after. > > Ah, pragma Warnings (Off) is not fair. When I get the warning, I > prefer to believe in the compiler. So it must exist a better way to do > it (and do not get the warning). You are wrong to always believe in the compiler. In GNAT, and most other compilers for Ada or any other language, a warning indicates that something MIGHT be wrong, not that something definitely IS wrong. You are smarter than the compiler (although perhaps not as detail oriented). When you see a warning, you should inspect the code, and if you think the code is correct, use pragma Warnings (Off, ...) to suppress it, along with a comment explaining why. Don't write less-elegant code just to make the compiler shut up. - Bob