Opened 9 years ago

Closed 8 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:


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@… 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by christian.leutloff@…

Attachment: path_hpp_boost_135.patch added

comment:1 Changed 9 years ago by Beman Dawes

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.


comment:2 Changed 9 years ago by basilevs@…

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 Changed 8 years ago by Beman Dawes

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.



Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Beman Dawes.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.