Experience with dealing with warnings from the Clang toolset?

I have added a little information on dealing with warnings when using the Clang toolset at https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines but I am sure there are people using Clang who can provide more detailed information and suggestions from their experiences. Please tell me if you have anything to add. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

Paul A. Bristow-2 wrote
Hi, do you know if something like the macro is available on Boost? It could be adapted to also to clang. Best, Vicente #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 #define GCC_DIAG_STR(s) #s #define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y) # define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) # if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \ GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) # else # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x)) # endif #else # define GCC_DIAG_OFF(x) # define GCC_DIAG_ON(x) #endif -- View this message in context: http://boost.2283326.n4.nabble.com/Experience-with-dealing-with-warnings-fro... Sent from the Boost - Users mailing list archive at Nabble.com.

I may give it a try (to avoid Mbyte of warnings (mainly from Boost library code - not mine) :-( but I was hoping someone had done this already :-) Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

I may give it a try (to avoid Mbyte of warnings (mainly from Boost library code - not mine) :-(
but I was hoping someone had done this already :-)
But since nobody has volunteered, here is my first stab at a worked example using a Macro adapted from Jonathan Wakely's version for GCC. But having tried it out, I conclude that eliminating warnings by better coding is much less trouble than playing "whack a mole" supressing for all known compilers! I have added this to the wiki page on warnings. https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines Other informed input still needed. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
participants (2)
-
Paul A. Bristow
-
Vicente Botet