BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compileroption for changing a warning to an error?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools)
View previous topic :: View next topic  
Author Message
Christian Killmann
Guest





PostPosted: Fri Mar 30, 2007 3:27 pm    Post subject: Compileroption for changing a warning to an error? Reply with 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?

Kind regards

-Christian
Back to top
Ebbe Kristensen
Guest





PostPosted: Fri Mar 30, 2007 4:29 pm    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote



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





PostPosted: Mon Apr 02, 2007 8:10 am    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote



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





PostPosted: Mon Apr 02, 2007 6:27 pm    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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





PostPosted: Mon Apr 02, 2007 6:34 pm    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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





PostPosted: Tue Apr 03, 2007 8:10 am    Post subject: Re: Compileroption for changing a warning to an error? Reply with 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!

Chris
Back to top
Ebbe Kristensen
Guest





PostPosted: Tue Apr 03, 2007 1:50 pm    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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





PostPosted: Tue Apr 03, 2007 6:44 pm    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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





PostPosted: Wed Apr 04, 2007 8:10 am    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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





PostPosted: Wed Apr 04, 2007 8:10 am    Post subject: Re: Compileroption for changing a warning to an error? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.