On 07/02/2013 07:12 AM, Ted Felix wrote:
> The customary way to handle this situation is as follows:
>
> void f(int i)
> {
> #ifdef DEBUG_SEQUENCE_MANAGER
> RG_DEBUG << i;
> #else
> i; // suppress compiler warning
> #endif
>
> // ...
> }
Actually, I'm a little bit off with this. In the case of a non-debug
build with DEBUG_SEQUENCE_MANAGER defined, that would still issue a
warning. The correct solution would be this:
void f(int i)
{
#ifdef NDEBUG
i; // suppress compiler warning
#endif
#ifdef DEBUG_SEQUENCE_MANAGER
RG_DEBUG << i;
#endif
// ...
}
Or more simply:
void f(int i)
{
i; // suppress compiler warning in non-debug builds
#ifdef DEBUG_SEQUENCE_MANAGER
RG_DEBUG << i;
#endif
// ...
}
Ted.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel