comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Make specific warning error with gnat?
Date: Tue, 06 Jul 2010 17:12:30 -0400
Date: 2010-07-06T17:12:30-04:00	[thread overview]
Message-ID: <wccy6doqpq9.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: i0kcdn$g44$1@nntp.ilk.net

Markus Schoepflin <nospam@no.spam> writes:

> 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.

In that case, I think you should read the docs about the various
warning switches, and turn off the ones you wish to ignore,
and turn on the ones you wish to fix.  Then use -gnatwe to
make all warnings (the ones you turned on) into errors.
Then fix those: for each warning, if the code is wrong,
fix the bug, and if not, use pragma Warnings(Off).

Don't be shy about using Warnings(Off).  The compiler is
sometimes wrong to warn, and the Warnings(Off) (with
a suitable comment) documents the fact that something
fishy is going on, but in this particular case it's OK.
Don't contort the code just to make the compiler happy.
It's usually a good idea to use the form of the pragma
that gives the warning text.

Note that you can turn off warnings globally in two ways:
with switches, or with pragmas in a configuration file.
The latter can be as fine-grained as you like.

For new code, -gnatwae is a good idea.  But that's
not your case.

- Bob



      parent reply	other threads:[~2010-07-06 21:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 10:13 Make specific warning error with gnat? Markus Schoepflin
2010-07-01 12:11 ` John B. Matthews
2010-07-01 14:05   ` Markus Schoepflin
2010-07-02  1:19     ` John B. Matthews
2010-07-02  9:30 ` Stephen Leake
2010-07-02  9:44   ` Markus Schoepflin
2010-07-02 20:17     ` Randy Brukardt
2010-07-06 21:18       ` Robert A Duff
2010-07-07 23:32         ` Randy Brukardt
2010-07-02 20:33     ` Georg Bauhaus
2010-07-03 10:00       ` Dmitry A. Kazakov
2010-07-05  8:16       ` Markus Schoepflin
2010-07-03  8:01     ` Stephen Leake
2010-07-04  2:22       ` BrianG
2010-07-06 21:12     ` Robert A Duff [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox