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: a07f3367d7,71d79ed4fdc42ae2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!open-news-network.org!noris.net!nntp.ilk.net!not-for-mail From: Markus Schoepflin Newsgroups: comp.lang.ada Subject: Re: Make specific warning error with gnat? Date: Fri, 02 Jul 2010 11:44:23 +0200 Organization: Customer of ILK Internet GmbH, Karlsruhe, Germany Message-ID: References: <82mxuaxmb1.fsf@stephe-leake.org> NNTP-Posting-Host: csdc.comsoft.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nntp.ilk.net 1278063863 16516 212.86.205.70 (2 Jul 2010 09:44:23 GMT) X-Complaints-To: usenet@ilk.net NNTP-Posting-Date: Fri, 2 Jul 2010 09:44:23 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 In-Reply-To: <82mxuaxmb1.fsf@stephe-leake.org> Xref: g2news1.google.com comp.lang.ada:12126 Date: 2010-07-02T11:44:23+02:00 List-Id: Am 02.07.2010 11:30, schrieb Stephen Leake: > Markus Schoepflin writes: [...] >> 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 would love to, but I'm dealing with a multi-million LOC legacy code base of Ada 83 in maintenance mode, which produces quite a large number of warnings. I neither have the time nor the resources available to fix all of them, nor am I allowed to do so. But if the compiler already knows that there will be a constraint error at runtime, I would have liked the compilation to fail. > 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. Markus