Skip to content

Commit 3ce1c74

Browse files
DanielaEvprus
authored andcommitted
Suppress msvc level-4 warnings.
Even when compiled at warning level 4 (i.e. all), project policies may require compilations without warnings issued. Signed-off-by: Daniela Engert <[email protected]>
1 parent 2acfab1 commit 3ce1c74

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

include/boost/program_options/options_description.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ namespace program_options {
236236
void print(std::ostream& os, unsigned width = 0) const;
237237

238238
private:
239+
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
240+
// prevent warning C4512: assignment operator could not be generated
241+
options_description& operator=(const options_description&);
242+
#endif
243+
239244
typedef std::map<std::string, int>::const_iterator name2index_iterator;
240245
typedef std::pair<name2index_iterator, name2index_iterator>
241246
approximation_range;

src/parsers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ namespace boost { namespace program_options {
220220
{
221221
// Intel-Win-7.1 does not understand
222222
// push_back on string.
223-
result += tolower(s[n]);
223+
result += static_cast<char>(tolower(s[n]));
224224
}
225225
}
226226
return result;

src/value_semantic.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,12 @@ namespace boost { namespace program_options {
268268

269269
void error_with_option_name::replace_token(const string& from, const string& to) const
270270
{
271+
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
272+
// prevent warning C4127: conditional expression is constant
273+
for (;;)
274+
#else
271275
while (1)
276+
#endif
272277
{
273278
std::size_t pos = m_message.find(from.c_str(), 0, from.length());
274279
// not found: all replaced

0 commit comments

Comments
 (0)