[ 
https://issues.apache.org/jira/browse/LOGCXX-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091395#comment-16091395
 ] 

Thorsten Schöning commented on LOGCXX-490:
------------------------------------------

This is what MS says about the warning, seems like our "while (0)" is the 
problem.

https://msdn.microsoft.com/en-us/library/6t66728h.aspx

> [...]trivial constants such as 1 or true do not trigger the warning[...]

I wonder why 0 or false shouldn't be handled the same way?

The macros are defined in logger.h, around lines 1750+. Could you please try 
with some other condition like "while (!1)" or "!true"? If that doesn't work, 
please try again with changing entirely to the suggested "for (;;)" and by 
including a "break" as last statement.

I don't have any MS compiler at hand, so it would be great if you could help 
with your tests.

> 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)

Reply via email to