From: Markus Schoepflin on
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?

Regards,
Markus
From: John B. Matthews on
In article <i0hpoh$vmk$1(a)nntp.ilk.net>,
Markus Schoepflin <nospam(a)no.spam> wrote:

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

You might be thinking of the -gnatwe option.

<http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gnat_ugn_unw/Warning-Message-Con
trol.html#Warning-Message-Control>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Markus Schoepflin on
Am 01.07.2010 14:11, schrieb John B. Matthews:

> You might be thinking of the -gnatwe option.

No, as -gnatwe turns all warnings into errors. I want to turn a specific
warning into an error, and leave the other warnings alone.

Markus
From: John B. Matthews on
In article <i0i7c7$nt2$1(a)nntp.ilk.net>,
Markus Schoepflin <nospam(a)no.spam> wrote:

> Am 01.07.2010 14:11, schrieb John B. Matthews:
>
> > You might be thinking of the -gnatwe option.
>
> No, as -gnatwe turns all warnings into errors. I want to turn a specific
> warning into an error, and leave the other warnings alone.

Ah, you want to turn a specific warning into an error, while not
suppressing other warnings. I usually just condition the make options.

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Stephen Leake on
Markus Schoepflin <nospam(a)no.spam> 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