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!news1.google.com!npeer02.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: <82mxuaxmb1.fsf@stephe-leake.org> Date: Sat, 03 Jul 2010 04:01:43 -0400 Message-ID: <82aaq9xac8.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:FvSpzkCKGChUihwqiOWOMhZLAPM= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1eb6a4c2eee6be197caa715003 Xref: g2news1.google.com comp.lang.ada:12157 Date: 2010-07-03T04:01:43-04:00 List-Id: Markus Schoepflin writes: > 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. I can understand not changing design in a maintenance situation, but adding 'pragma Warnings (off)' in places ought to be ok. Still, it can be a lot of work. > But if the compiler already knows that there will be a constraint > error at runtime, I would have liked the compilation to fail. Using GNAT project files, you can specify -gnatwe for particular files: for Switches ("sal-gen-alg.adb") use Standard_Common.Compiler'Default_Switches ("Ada") & Standard_Common.Compiler.Release_Switches & ("-gnatwe"); Not quite what you want, but it might help. -- -- Stephe