c++ - Suppressing warning 6 without disabling it
- Johnny Willemsen (11/11) Sep 23 2004 Hi,
- Włodzimierz Skiba (14/17) Sep 23 2004 In wxWidgets we have:
- Johnny Willemsen (8/25) Sep 24 2004 Hi,
- Walter (6/16) Sep 30 2004 but
Hi, When building ACE/TAO I get the warning: Warning 6: value of expression is not used In ACE/TAO we use a macro ACE_UNUSED_ARG for arguments which are there, but not used under certain conditions. The macro is defined as or But both don't suppress the warning with DMC? Anyone an idea how to get rid of warning 6, with such a macro, we don't want do disable it completely. Johnny
Sep 23 2004
"Johnny Willemsen" <jwillemsen remedy.nl> wrote in news:ciuli7$1d7s$1 digitaldaemon.com:Anyone an idea how to get rid of warning 6, with such a macro, we don't want do disable it completely.In wxWidgets we have: #define WXUNUSED(identifier) #ifdef __BORLANDC__ #else template <class T> inline void wxUnusedVar(const T& WXUNUSED(t)) { } #endif and then write code which afaik works with all c++ compilers we support (including DMC): wxUnusedVar(some_variable); ABX
Sep 23 2004
Hi, Thanks for this, I have added such a construct also to ACE. I only observed that the template way of doing this, increases the size of the app a little, the do/while solution is optimized out by the compiler, the template probably not. Johnny "Włodzimierz Skiba" <abx abx.art.pl> wrote in message news:ciurr4$1j0m$1 digitaldaemon.com..."Johnny Willemsen" <jwillemsen remedy.nl> wrote in news:ciuli7$1d7s$1 digitaldaemon.com:Anyone an idea how to get rid of warning 6, with such a macro, we don't want do disable it completely.In wxWidgets we have: #define WXUNUSED(identifier) #ifdef __BORLANDC__ #else template <class T> inline void wxUnusedVar(const T& WXUNUSED(t)) { } #endif and then write code which afaik works with all c++ compilers we support (including DMC): wxUnusedVar(some_variable); ABX
Sep 24 2004
"Johnny Willemsen" <jwillemsen remedy.nl> wrote in message news:ciuli7$1d7s$1 digitaldaemon.com...Hi, When building ACE/TAO I get the warning: Warning 6: value of expression is not used In ACE/TAO we use a macro ACE_UNUSED_ARG for arguments which are there,butnot used under certain conditions. The macro is defined as or But both don't suppress the warning with DMC? Anyone an idea how to getridof warning 6, with such a macro, we don't want do disable it completely.-w6 see www.digitalmars.com/ctg/sc.html#dashw
Sep 30 2004