Hi all,
I have just disabled the compilation warning #4224 for VC2005 by adding the corresponding preprocessor command in ql/config.msvc.hpp. I’m wondering if disabling uncommon compilation warning at a more local level would‘nt be more appropriated. Indeed changing a line in ql/config.msvc.hpp trigger the whole recompilation of QL, and increase the size of a file which will be read hundred of times. For example the compilation warning #4180 which appears only during matrix.cpp compilation could be disabled the following way:
#if defined (BOOST_MSVC) #pragma warning (disable: 4180) #endif
#include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/ublas/lu.hpp>
#if defined (BOOST_MSVC) #pragma warning (default: 4180) #endif
Since the compilation warning #4224 appear every time boost/function.hpp is included (9 times in QL) we might define some handy macros somewhere:
#define QL_SAFE_BOOST_FUNCTION_INCLUDE \ #if defined (BOOST_MSVC) \ #pragma warning (disable: 4224) \ #endif \ #include <boost/function.hpp> \ #if defined (BOOST_MSVC) \ #pragma warning (default: 4224) \ #endif \
any thoughts ? François ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
On Fri, 2007-05-25 at 12:56 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS
GASAPRD PHI wrote: > I have just disabled the compilation warning #4224 for VC2005 by > adding the corresponding preprocessor command in ql/config.msvc.hpp. > I’m wondering if disabling uncommon compilation warning at a more > local level would‘nt be more appropriated. True--in fact, I did it locally in the 0.8.0 branch. It will appear in the trunk when we merge it. Later, Luigi ---------------------------------------- Dealing with failure is easy: work hard to improve. Success is also easy to handle: you've solved the wrong problem. Work hard to improve. -- Alan Perlis ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
In reply to this post by DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI
Ok thks, what about the #4180 ? François -----Original Message----- From: Luigi Ballabio [mailto:[hidden email]] Sent: Friday, May 25, 2007 3:47 PM To: DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI Cc: [hidden email] Subject: Re: [Quantlib-dev] disabling compilation warnings On Fri, 2007-05-25 at 12:56 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI wrote: > I have just disabled the compilation warning #4224 for VC2005 by > adding the corresponding preprocessor command in ql/config.msvc.hpp. > I'm wondering if disabling uncommon compilation warning at a more > local level would'nt be more appropriated. True--in fact, I did it locally in the 0.8.0 branch. It will appear in the trunk when we merge it. Later, Luigi ---------------------------------------- Dealing with failure is easy: work hard to improve. Success is also easy to handle: you've solved the wrong problem. Work hard to improve. -- Alan Perlis ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
On Fri, 2007-05-25 at 17:43 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS
GASAPRD PHI wrote: > Ok thks, what about the #4180 ? It could be dealt with in the same way. What is the warning about? Later, Luigi P.S. About your suggestion of a macro such as: #define QL_SAFE_BOOST_FUNCTION_INCLUDE \ #pragma warning (disable: 4224) \ etc. I am not sure how the preprocessor works. If a pragma is inside a macro definition, does it get executed when the preprocessor reads it (i.e., when the macro is defined, which doesn't make us any good) or when the macro is expanded? > -----Original Message----- > From: Luigi Ballabio [mailto:[hidden email]] > Sent: Friday, May 25, 2007 3:47 PM > To: DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI > Cc: [hidden email] > Subject: Re: [Quantlib-dev] disabling compilation warnings > > On Fri, 2007-05-25 at 12:56 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS > GASAPRD PHI wrote: > > I have just disabled the compilation warning #4224 for VC2005 by > > adding the corresponding preprocessor command in ql/config.msvc.hpp. > > I'm wondering if disabling uncommon compilation warning at a more > > local level would'nt be more appropriated. > > True--in fact, I did it locally in the 0.8.0 branch. It will appear in > the trunk when we merge it. > > Later, > Luigi > > > ---------------------------------------- > > Dealing with failure is easy: work hard to improve. Success is also > easy to handle: you've solved the wrong problem. Work hard to improve. > -- Alan Perlis > > ---------------------------------------- Testing can never demonstrate the absence of errors in software, only their presence. -- W.E. Dijkstra ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi,
Yes they work within macros - only if the macro is defined (You'll see a check for windows in the example below). But you might want to use something a little more fine grain. When you just outright disable the warning, you can miss valuable information in other files that include the offending header only through some odd hierarchy. You can disable a warning around a specific function (or line in your code or include statement): /* Disable "Unreferenced Formal Parameter Warning" */ #ifdef WIN32 #pragma warning( push ) #pragma warning( disable: 4100 ) #endif I've got a specialized template function right here that doesn't use one of the more general parameters, but -- to keep the interface the same -- I've left the parameter in, ignore it, & I deem it ok to turn off the warning for this function. After the offending function you can then re-enable the warning: /* Re-Enable "Unreferenced Formal Parameter Warning" */ #ifdef WIN32 #pragma warning( pop ) #endif In this way, only the warnings that you specifically comment on are disabled at the exact location in question. And notice I've used a check for WIN32 - I don't yet do any development in cygwin or Mingw w/ gcc so perhaps those could be replaced with a check for visual studio. - Matt Ps. I realize this isn't the forum to ask - but has anyone here tried using the visual studio compiler with eclipse?? I'd like to use MSBuild instead of Mingw so that I can move to eclipse & transparently use the solution/project files that the rest of the team depends on in Visual Studio. On 5/25/07, Luigi Ballabio <[hidden email]> wrote: > On Fri, 2007-05-25 at 17:43 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS > GASAPRD PHI wrote: > > Ok thks, what about the #4180 ? > > It could be dealt with in the same way. What is the warning about? > > Later, > Luigi > > P.S. About your suggestion of a macro such as: > > #define QL_SAFE_BOOST_FUNCTION_INCLUDE \ > #pragma warning (disable: 4224) \ > etc. > > I am not sure how the preprocessor works. If a pragma is inside a macro > definition, does it get executed when the preprocessor reads it (i.e., > when the macro is defined, which doesn't make us any good) or when the > macro is expanded? > > > > -----Original Message----- > > From: Luigi Ballabio [mailto:[hidden email]] > > Sent: Friday, May 25, 2007 3:47 PM > > To: DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI > > Cc: [hidden email] > > Subject: Re: [Quantlib-dev] disabling compilation warnings > > > > On Fri, 2007-05-25 at 12:56 +0200, DU VIGNAUD DE VILLEFORT FRANCOIS > > GASAPRD PHI wrote: > > > I have just disabled the compilation warning #4224 for VC2005 by > > > adding the corresponding preprocessor command in ql/config.msvc.hpp. > > > I'm wondering if disabling uncommon compilation warning at a more > > > local level would'nt be more appropriated. > > > > True--in fact, I did it locally in the 0.8.0 branch. It will appear in > > the trunk when we merge it. > > > > Later, > > Luigi > > > > > > ---------------------------------------- > > > > Dealing with failure is easy: work hard to improve. Success is also > > easy to handle: you've solved the wrong problem. Work hard to improve. > > -- Alan Perlis > > > > > > ---------------------------------------- > > Testing can never demonstrate the absence of errors in software, only > their presence. > -- W.E. Dijkstra > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > QuantLib-dev mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
In reply to this post by DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI
>It could be dealt with in the same way. What is the warning about? Nothing to worry about IMO, here is the description from MSDN: A qualifier, such as const, is applied to a function type defined by typedef. Example: // C4180.cpp // compile with: /W1 /c typedef int *FuncType(void); // the const qualifier cannot be applied to the // function type FuncType const FuncType f; // C4180 François ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |