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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,71d79ed4fdc42ae2 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!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Make specific warning error with gnat? References: Date: Fri, 02 Jul 2010 05:30:58 -0400 Message-ID: <82mxuaxmb1.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:FX3Tu1L0iqihhYBgY/GKf6UXO8w= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: b339c4c2db1cfe197caa731921 Xref: g2news1.google.com comp.lang.ada:12125 Date: 2010-07-02T05:30:58-04:00 List-Id: Markus Schoepflin writes: > Hello, > > I seem to remember that with gnat it was possible to turn a specific > warning into an error. I couldn't find anything in the docs, now I'm > not sure if this really was gnat or some other compiler which offered > this feature. > > Anyway, what I want is a compile time error for the warning > "Constraint_Error" will be raised at run time. > > Is this possible with gnat without turning all warnings into errors? Just out of curiosity, why not treat all warnings as errors? gnat is a very good compiler; the warnings it produces should be taken seriously. I have a policy of always eliminating all warnings. Sometimes that means redesigning the code, which in the end turns out to be a good thing. There are times when the only way to eliminate a warning is to use pragma Warings (Off), or give a file-specific compiler option in a project file. But that is rare, and the benefits from otherwise eliminating warnings is large. -- -- Stephe