#8403 closed Support Requests (fixed)
VC++ 2012 compiler warning C4127: conditional expression is constant
Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|
Milestone: | To Be Determined | Component: | geometry |
Version: | Boost 1.52.0 | Severity: | Cosmetic |
Keywords: | VC++ 2012, warning, C4127, conditional expression is constant | Cc: |
Description
I'm using Microsoft Visual Studio 2012 to compile boost 1.52.0. I use compiler flag /W4. The following warnings (which we declared errors for our project) occur in geometry, regardless whether I'm compiling for x64 or x86:
\boost_1_52_0\boost\geometry\algorithms\convert.hpp(96): error C4127: conditional expression is constant if (Close) ...
\boost_1_52_0\boost\geometry\algorithms\detail\overlay\get_turns.hpp(263): error C4127: conditional expression is constant if (InterruptPolicy::enabled) ...
\boost_1_52_0\boost\geometry\algorithms\num_points.hpp(51): error C4127: conditional expression is constant if (s == open) ...
Maybe it's possible to eliminate those warnings for the next boost version?
Change History (5)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Severity: | Problem → Cosmetic |
---|---|
Type: | Bugs → Support Requests |
This is not a bug. This requires considerable rewriting and adding speciliazations. Postponed.
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 10 years ago
After doubting about this one, and looking at other Boost.Libraries, it is indeed probably the best to use #pragma's here. Many libraries do the same for the same problem.
Alternatives were rewriting (too much), or declaring local non-const variables to avoid this warning (I considered this as too much workaround for this message only, and this has a (though small) performance penalty)
So pragmas are added yesterday.
Sorry, I mixed the code with the message. Unfortunately I cannot edit the original post, so here are the messages with the correct line breaks: