| View previous topic :: View next topic |
| Author |
Message |
Christian Killmann Guest
|
Posted: Fri Mar 30, 2007 3:27 pm Post subject: Compileroption for changing a warning to an error? |
|
|
Hello,
I'm using BDS2006 BCC32 V5.82, ILINK32 V5.70.
Is there a way to let the compiler stop at a specific warning instead of
just displaying it? Probably a compiler option like for example -we8030?
Kind regards
-Christian |
|
| Back to top |
|
 |
Ebbe Kristensen Guest
|
Posted: Fri Mar 30, 2007 4:29 pm Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Christian Killmann wrote:
| Quote: | Hello,
I'm using BDS2006 BCC32 V5.82, ILINK32 V5.70.
Is there a way to let the compiler stop at a specific warning instead
of just displaying it? Probably a compiler option like for example
-we8030?
|
Such as:
-w! Return non-zero from compiler on warnings
Makes the build stop when using makefiles.
Ebbe |
|
| Back to top |
|
 |
Christian Killmann Guest
|
Posted: Mon Apr 02, 2007 8:10 am Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Hi Ebbe,
thanks for your reply. I tried -w! before posting to this newsgroup and
didn't manage to stop the compiler only on a specific warning. I think
that -w! just stops at every warning, and that is sadly no option for me. Or
am i just missing some tricky syntax?
Kind regards
-Chris |
|
| Back to top |
|
 |
Ebbe Kristensen Guest
|
Posted: Mon Apr 02, 2007 6:27 pm Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Christian Killmann wrote:
| Quote: | thanks for your reply. I tried -w! before posting to this newsgroup
and didn't manage to stop the compiler only on a specific warning.
|
Sorry, I overlooked the "specific" part of it.
Ebbe |
|
| Back to top |
|
 |
Ebbe Kristensen Guest
|
Posted: Mon Apr 02, 2007 6:34 pm Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Christian Killmann wrote:
| Quote: | thanks for your reply. I tried -w! before posting to this newsgroup
and didn't manage to stop the compiler only on a specific warning. I
think
that -w! just stops at every warning, and that is sadly no option for
me. Or am i just missing some tricky syntax?
|
I though a little more about it and came up with this workaround:
bcc32 <whatever> | grep -v "Warning 8030"
The -v option makes grep return a non-zero error code if it finds the
warning in question.
Ebbe |
|
| Back to top |
|
 |
Christian Killmann Guest
|
Posted: Tue Apr 03, 2007 8:10 am Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Thank you for this nice trick. I will try it in my makefiles, but it's a bit
sad, that the compiler itself doesn't support this behaviour!
Chris |
|
| Back to top |
|
 |
Ebbe Kristensen Guest
|
Posted: Tue Apr 03, 2007 1:50 pm Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Christian Killmann wrote:
| Quote: | Thank you for this nice trick. I will try it in my makefiles, but
it's a bit sad, that the compiler itself doesn't support this
behaviour!
|
Thinking further about it, it is not so nice after all. Using this trick,
you will get a zero errorcode unless that warning occurs, i.e. it will not
catch compiler errors. Maybe this modification is better:
bcc32 <whatever> | grep -v "Error|Warning 8030"
but you will have to test it.
Ebbe |
|
| Back to top |
|
 |
Ed Mulroy Guest
|
Posted: Tue Apr 03, 2007 6:44 pm Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Consider using a #pragma checkoption encasing a #pragma error?
.. Ed
| Quote: | Christian Killmann wrote in message
news:4612028d$1 (AT) newsgroups (DOT) borland.com... |
|
|
| Back to top |
|
 |
Christian Killmann Guest
|
Posted: Wed Apr 04, 2007 8:10 am Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Thanks again Ebbe,
i will try your trick to use grep as an artifical sentinel for the compiler.
No problem when i have to find out some of the details on my own! :-)
-Chris |
|
| Back to top |
|
 |
Christian Killmann Guest
|
Posted: Wed Apr 04, 2007 8:10 am Post subject: Re: Compileroption for changing a warning to an error? |
|
|
Thank you for the reply Ed,
but as far as i understood #pragma checkoption just checks if an option is
set or not. Is a compiler error visible over checkoption? If it is, is there
a way to set the pragma globally for all my hundreds of source files?
Kind regards
-Chris |
|
| Back to top |
|
 |
|