Modify

Opened 5 years ago

Last modified 4 years ago

#8021 new Bugs

gcc: ptree_utils.hpp:76: warning: comparison is always false due to limited range of data type [-Wtype-limits]

Reported by: anonymous Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc: mateusz@…

Description (last modified by Mateusz Loskot)

gcc version 4.7.2 (Built by MinGW-builds project) i686-w64-mingw32

yields

boost/property_tree/detail/ptree_utils.hpp: In instantiation of 'std::string boost::property_tree::detail::narrow(const Ch*) [with Ch = wchar_t; std::string = std::basic_string<char>]':
boost/property_tree/string_path.hpp:64:36:   required from here
boost/property_tree/detail/ptree_utils.hpp:76:13: warning: comparison is always false due to limited range of data type [-Wtype-limits]

76: if (*text < 0 || *text > (std::numeric_limits<char>::max)())

Attachments (1)

boost-8021a.diff (1.2 KB) - added by kailoran@… 5 years ago.
C++11-only patch to fix the warning

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by kailoran@…

Attachment: boost-8021a.diff added

C++11-only patch to fix the warning

comment:1 Changed 5 years ago by Gaurav Gupta <g.gupta@…>

I also faced this warning, with some Arm compiler. I applied a temporary fix by adding #pragma Macros in the header file.

comment:2 Changed 4 years ago by Mateusz Loskot

Description: modified (diff)

comment:3 Changed 4 years ago by Gaurav Gupta <g.gupta@…>

I removed this warning as below:

#if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #else for GCC compiler, treat as 'system header' to avoid compiler warnings in boost code # pragma GCC system_header #endif

comment:4 Changed 4 years ago by Mateusz Loskot

Cc: mateusz@… added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Sebastian Redl.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.