[
https://issues.apache.org/jira/browse/LOGCXX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091494#comment-16091494
]
Thorsten Schöning commented on LOGCXX-490:
------------------------------------------
Have a look at the head of logger.h, there's already a list of warnings for MSC
to ignore, where you can add this one for log4cxx only:
{quote}
#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4231 4251 4275 4786 )
#endif
{quote}
On the other hand, there's the following from your provided link:
{QUOTE}
#ifdef WIN32
# define ONCE __pragma( warning(push) ) \
__pragma( warning(disable:4127) ) \
while( 0 ) \
__pragma( warning(pop) )
#else
# define ONCE while( 0 )
#endif
{QUOTE}
We would simply need to replace "WIN32" with "_MSC_VER" up to 2015 or up to
including your 2013. While I don't like the readability of that change, it's
less global than disabling the warning for this file. I'm undecided what to
prefer... Any opinions?
> conditional expression is constant
> ----------------------------------
>
> Key: LOGCXX-490
> URL: https://issues.apache.org/jira/browse/LOGCXX-490
> Project: Log4cxx
> Issue Type: Improvement
> Reporter: Sebastian Geiger
> Priority: Minor
>
> When I activate the /W4 warning level in MSVC 2013 I get the following
> warning:
> warning C4127: conditional expression is constant
> The warning appears for all statements that use the LOG4CXX_* macros suchas
> LOG4CXX_ERROR. I currently get more than 500 if these warnings, which makes
> identifying more important warnings rather difficult.
> Of course I could disable the warning, but if this is something that could be
> fixed in the log4cxx code then I think that would be a better solution.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)