Opened 14 years ago

Closed 13 years ago

#2543 closed Bugs (fixed)

path.hpp:947: warning: comparison between signed and unsigned integer expressions

Reported by: christian.leutloff@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.37.0 Severity: Problem
Keywords: path, compiler, warning Cc:

Description

Including boost/filesystem.hpp leads to this warning (repeated some more times for other lines of code):

path.hpp:947: warning: comparison between signed and unsigned integer expressions

The compiler is gcc 4.2.3 build for QNX 6. It is executed under WinXP.

I'm using boost 1.35. But I have verified that the relevant code sections in path.hpp are unchanged in svn boost/trunk as of Nov. 25. Therefore I would assume that this problem is present in newer versions of boost, too. In version 1.33.1 this problem was not present.

The warning is "fixed" through a typecast from the colon<value_type> to (typename string_type::value_type). This applies for slash, too.

I'm not sure that the typecast is the right solution. But at least it works for me ...

I'll attach the diff against boost version 1.35 to show the affected lines of code. If useful I am willing to move the changes or modified changes to trunk, too. Please drop me a note if it would be helpful.

Many many thanks to all the people bringing boost to me! It is a great to be able to use this powerful lib.

Attachments (1)

path_hpp_boost_135.patch (7.5 KB ) - added by christian.leutloff@… 14 years ago.

Download all attachments as: .zip

Change History (4)

by christian.leutloff@…, 14 years ago

Attachment: path_hpp_boost_135.patch added

comment:1 by Beman Dawes, 14 years ago

Resolution: fixed
Status: newclosed

Hopefully this has now been fixed by revision 50556.

Since none of the compilers I use issue the warning, please reopen the issue if your compiler still warns.

--Beman

comment:2 by basilevs@…, 14 years ago

Resolution: fixed
Status: closedreopened

I'm using: boost 1.37 mingw with gcc 1.34 stlport 5.2.1

All these errors appear again.

comment:3 by Beman Dawes, 13 years ago

Resolution: fixed
Status: reopenedclosed

The fix wasn't in 1.37. The first release with the fix was 1.38.

If there is any further report of signed vs unsigned comparison warning, please include full information on the version of all software involved, and a copy of one of the warnings.

Thanks,

--Beman

Note: See TracTickets for help on using tickets.