473,473 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Disabling/Enabling /WX via pragma

Hi,

I like to know if is it possible to disable/reenable /WX (treat warning
as error) via #pragma on my code.

TIA.
Marco.
--
For direct reply change underscore to dot

Nov 17 '05 #1
2 1174
Hi Marco Segurini,
I like to know if is it possible to disable/reenable /WX (treat warning
as error) via #pragma on my code.


See: C/C++ Preprocessor Reference: warning
http://msdn.microsoft.com/library/en...ir_warning.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
Jochen Kalmbach wrote:
Hi Marco Segurini,

I like to know if is it possible to disable/reenable /WX (treat warning
as error) via #pragma on my code.

See: C/C++ Preprocessor Reference: warning
http://msdn.microsoft.com/library/en...ir_warning.asp


Thanks Jochen,

I already tryed that way but there are cases where #pragma warning does
not work:

//----------------------
#include <algorithm>
#include <iostream>
#include <vector>

#include <boost/lambda/lambda.hpp>

#pragma warning(push)
#pragma warning(disable : 4512)
void call()
{
std::vector<int> MyVect(10);
std::for_each(MyVect.begin(), MyVect.end(), std::cout <<
boost::lambda::_1 << '\n');
}
#pragma warning(pop)
int main()
{
call();
return 0;
}
//----------------------

this code compiled with /W4 and /WX returns these output on both VS2003
and VS2005

------ Build started: Project: BoostLambda, Configuration: Debug Win32
------

Compiling...
BoostLambda.cpp
e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(48)
: warning C4512: 'boost::lambda::identity<T>' : assignment operator
could not be generated
with
[

T=boost::lambda::bound_argument_conversion<boost:: tuples::tuple<boost::lambda::detail::IF<true,std:: ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>::head_type::type ]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(118)
: see reference to class template instantiation
'boost::lambda::identity<T>' being compiled
with
[

T=boost::lambda::bound_argument_conversion<boost:: tuples::tuple<boost::lambda::detail::IF<true,std:: ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>::head_type::type ]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(169)
: see reference to class template instantiation
'boost::lambda::lambda_functor<T>' being compiled
with
[

T=boost::lambda::identity<boost::lambda::bound_arg ument_conversion<boost::tuples::tuple<boost::lambd a::detail::IF<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>::head_type::type> ]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(218)
: see reference to class template instantiation
'boost::lambda::detail::deduce_argument_types_<Arg s,SigArgs>' being compiled
with
[

Args=boost::tuples::tuple<boost::lambda::detail::I F<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>,
SigArgs=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\operator_lambda_func_base.hpp(65)
: see reference to class template instantiation
'boost::lambda::detail::deduce_argument_types<Args ,SigArgs>' being compiled
with
[

Args=boost::tuples::tuple<boost::lambda::detail::I F<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>,
SigArgs=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\operator_lambda_func_base.hpp(217)
: see reference to class template instantiation
'boost::lambda::detail::binary_rt<Action,Bound,Ope n>' being compiled
with
[

Action=boost::lambda::bitwise_action<boost::lambda ::leftshift_action>,

Bound=boost::tuples::tuple<boost::lambda::detail:: IF<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>,
Open=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(139)
: see reference to class template instantiation
'boost::lambda::lambda_functor_base<Act,Args>::sig <SigArgs>' being compiled
with
[

Act=boost::lambda::bitwise_action<boost::lambda::l eftshift_action>,

Args=boost::tuples::tuple<boost::lambda::detail::I F<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>,
SigArgs=boost::tuples::null_type
]
e:\Prove\C++ NET
2003\BoostLambda\BoostLambda\BoostLambda.cpp(12) : see reference to
class template instantiation 'boost::lambda::lambda_functor<T>' being
compiled
with
[

T=boost::lambda::lambda_functor_base<boost::lambda ::bitwise_action<boost::lambda::leftshift_action>, boost::tuples::tuple<boost::lambda::detail::IF<tru e,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>
]
e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(209)
: warning C4512: 'boost::lambda::lambda_functor<T>' : assignment
operator could not be generated
with
[

T=boost::lambda::identity<boost::lambda::bound_arg ument_conversion<boost::tuples::tuple<boost::lambd a::detail::IF<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>::head_type::type>

]
e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(48)
: warning C4512: 'boost::lambda::identity<T>' : assignment operator
could not be generated
with
[
T=const boost::lambda::bound_argument_conversion<const
boost::tuples::cons<const boost::lambda::detail::parameter_traits_<const
char,const boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::detail::map_tuple _to_cons<boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type>::type>::head_type>::type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(118)
: see reference to class template instantiation
'boost::lambda::identity<T>' being compiled
with
[
T=const boost::lambda::bound_argument_conversion<const
boost::tuples::cons<const boost::lambda::detail::parameter_traits_<const
char,const boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::detail::map_tuple _to_cons<boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type>::type>::head_type>::type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(169)
: see reference to class template instantiation
'boost::lambda::lambda_functor<T>' being compiled
with
[
T=boost::lambda::identity<const
boost::lambda::bound_argument_conversion<const boost::tuples::cons<const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::detail::map_tuple _to_cons<boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type>::type>::head_type>::type>
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(174)
: see reference to class template instantiation
'boost::lambda::detail::deduce_argument_types_<Arg s,SigArgs>' being compiled
with
[

Args=boost::tuples::tuple<boost::lambda::lambda_fu nctor<boost::lambda::lambda_functor_base<boost::la mbda::bitwise_action<boost::lambda::leftshift_acti on>,boost::tuples::tuple<boost::lambda::detail::IF <true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>::tail_type,
SigArgs=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functor_base.hpp(218)
: see reference to class template instantiation
'boost::lambda::detail::deduce_argument_types_<Arg s,SigArgs>' being compiled
with
[

Args=boost::tuples::tuple<boost::lambda::lambda_fu nctor<boost::lambda::lambda_functor_base<boost::la mbda::bitwise_action<boost::lambda::leftshift_acti on>,boost::tuples::tuple<boost::lambda::detail::IF <true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>,
SigArgs=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\operator_lambda_func_base.hpp(65)
: see reference to class template instantiation
'boost::lambda::detail::deduce_argument_types<Args ,SigArgs>' being compiled
with
[

Args=boost::tuples::tuple<boost::lambda::lambda_fu nctor<boost::lambda::lambda_functor_base<boost::la mbda::bitwise_action<boost::lambda::leftshift_acti on>,boost::tuples::tuple<boost::lambda::detail::IF <true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>,
SigArgs=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\operator_lambda_func_base.hpp(217)
: see reference to class template instantiation
'boost::lambda::detail::binary_rt<Action,Bound,Ope n>' being compiled
with
[

Action=boost::lambda::bitwise_action<boost::lambda ::leftshift_action>,

Bound=boost::tuples::tuple<boost::lambda::lambda_f unctor<boost::lambda::lambda_functor_base<boost::l ambda::bitwise_action<boost::lambda::leftshift_act ion>,boost::tuples::tuple<boost::lambda::detail::I F<true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>,
Open=boost::tuples::null_type
]

e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(139)
: see reference to class template instantiation
'boost::lambda::lambda_functor_base<Act,Args>::sig <SigArgs>' being compiled
with
[

Act=boost::lambda::bitwise_action<boost::lambda::l eftshift_action>,

Args=boost::tuples::tuple<boost::lambda::lambda_fu nctor<boost::lambda::lambda_functor_base<boost::la mbda::bitwise_action<boost::lambda::leftshift_acti on>,boost::tuples::tuple<boost::lambda::detail::IF <true,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>,
SigArgs=boost::tuples::null_type
]
e:\Prove\C++ NET
2003\BoostLambda\BoostLambda\BoostLambda.cpp(12) : see reference to
class template instantiation 'boost::lambda::lambda_functor<T>' being
compiled
with
[

T=boost::lambda::lambda_functor_base<boost::lambda ::bitwise_action<boost::lambda::leftshift_action>, boost::tuples::tuple<boost::lambda::lambda_functor <boost::lambda::lambda_functor_base<boost::lambda: :bitwise_action<boost::lambda::leftshift_action>,b oost::tuples::tuple<boost::lambda::detail::IF<true ,std::ostream
&,const
boost::lambda::const_copy_argument<std::ostream>:: type>::RET,boost::lambda::lambda_functor<boost::la mbda::placeholder<1>>,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type,boost::tuples::null_type,boo st::tuples::null_type>>>,const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type,boost::tuples::null_type,boost:: tuples::null_type>>
]
e:\Programming\Boost\boost_1_31_0\boost\lambda\det ail\lambda_functors.hpp(209)
: warning C4512: 'boost::lambda::lambda_functor<T>' : assignment
operator could not be generated
with
[
T=boost::lambda::identity<const
boost::lambda::bound_argument_conversion<const boost::tuples::cons<const
boost::lambda::detail::parameter_traits_<const char,const
boost::lambda::detail::IF<false,const char &,const
char>::RET>::type,boost::tuples::detail::map_tuple _to_cons<boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type,boost::tuples::null_type,boost::tuples::n ull_type>::type>::head_type>::type>
]

Build log was saved at "file://e:\Prove\C++ net
2003\BoostLambda\BoostLambda\Debug\BuildLog.htm"
BoostLambda - 0 error(s), 4 warning(s)
---------------------- Done ----------------------

Build: 1 succeeded, 0 failed, 0 skipped
Any Ideas?
thanks.
Marco.

--
For direct reply change underscore to dot

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: sonic_soul | last post by:
Hello, I am finishing up creating a fairly complex page that is very rich in DHTML. In addition to updating it self every couple of seconds, various components on it support sync and async...
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
2
by: HumptyDumpty | last post by:
Does anyone know if there is a problem with re-enabling the Screen Saver after it has been disabled programmatically. I am using the SystemParametersInfo function within User32.dll, and have...
2
by: adeelanjum2001 | last post by:
i am using radiolist box control in my page. when i disable radiolist box when page is displayed first time, that is not ispostback, and when i try to enable it with my javascript code afterwards,...
4
by: Rich P | last post by:
Greetings, I have a routine I was running in VB6 on a timed schedule. When the timeframe came up, the timer would be disable, the routine would run, and the timer gets enabled. I am trying to...
7
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
7
by: Vignesh | last post by:
I have tab control which has some TabPages. I want to enable or disable the tabpages based on some condition. It is possible to that. Thanks in advance.
2
by: dougawells | last post by:
Hi- I'm wanting to have a set of radio buttons disabled when a form is displayed, then if they check another specific radio button, those would become enabled. I've tried setting it via...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.