Open GoogleCodeExporter opened 9 years ago
Would that work in case of assert too? For example:
void rcWunderBar(const rcFoo* foo)
{
RC_UNUSED(foo);
rcAssert(foo);
return RC_WUNDER;
}
Original comment by memono...@gmail.com
on 23 Aug 2010 at 3:42
Oh, and the point of that assert is that for the sake of integrity, I chose to
make majority of the Recast interface to require the build context as
parameter, and since it is a pointer, I use assert to make sure there is no
programmer error there.
Original comment by memono...@gmail.com
on 23 Aug 2010 at 3:44
Yeah - it'd work for the assert too. The code sample you've given is fine -
that'd get rid of the compiler warning AND enable you to comment the assert
back in. I use this technique a lot...because I quite often have a function
param that is only used in debug.
Original comment by armstron...@gmail.com
on 23 Aug 2010 at 4:12
This works too:
void foo( Bar bar )
{
bar; // Ignored
}
Eliminates the macro (and thus a code dependency, likely a header dependency).
It's willful and explicit by comment.
Original comment by copperp...@gmail.com
on 28 Oct 2010 at 12:42
How confident are you that that works on all compilers?
Original comment by armstron...@gmail.com
on 28 Oct 2010 at 1:59
Very...? Doesn't it guarantee a no-op?
Original comment by copperp...@gmail.com
on 28 Oct 2010 at 4:40
From: http://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/
template<class T> void ignore( const T& ) { }
Original comment by mends...@gmail.com
on 30 Mar 2011 at 6:31
Original issue reported on code.google.com by
armstron...@gmail.com
on 23 Aug 2010 at 3:20