Opened 15 years ago

Closed 15 years ago

#952 closed Bugs (fixed)

Visual C++ warning for boost::hash<std::size_t>

Reported by: - Owned by: Thomas Witt
Milestone: Boost 1.34.1 Component: hash
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc:

Description

When compiling for 32 bit windows, Visual C++ warns that boost::hash<std::size_t> won't work for 64 bit windows because it doesn't supply an overload for the 64-bit std::size_t. It actually does, but the 32 bit compile doesn't see it as it's only included when compiling for 64-bit windows. So the warning is wrong in this case. But it is generally useful so it's a good idea to avoid it. For a full description of the problem, see Joaquín's mail.

The proper solution is to add full support for long long - which has been in HEAD for some time. But if it isn't possible to add that to the post 1.34 release, a temporary fix will be to add the pragmas suggested by Joaquín. It would also be a good idea to clean up a mostly harmless inconsistency between the declaration and definition of the 64-bit std::size_t hash_value.

Attachments (2)

hash-warning.patch (1.9 KB ) - added by Daniel James 15 years ago.
Patch that hopefully fixes this.
hash-warning2.patch (1.0 KB ) - added by Daniel James 15 years ago.
Fixes a mistake in the first patch.

Download all attachments as: .zip

Change History (8)

comment:1 by Daniel James, 15 years ago

Milestone: Boost 1.34.1
Owner: changed from - to Daniel James
Severity: Problem
Version: release 1.34.0

by Daniel James, 15 years ago

Attachment: hash-warning.patch added

Patch that hopefully fixes this.

comment:2 by Thomas Witt, 15 years ago

Owner: changed from Daniel James to Thomas Witt

Patch applied

comment:3 by Thomas Witt, 15 years ago

Status: newassigned

by Daniel James, 15 years ago

Attachment: hash-warning2.patch added

Fixes a mistake in the first patch.

comment:4 by Daniel James, 15 years ago

Thanks for checking the patch in. I just tried it on some more compilers and found a mistake. The new patch fixes it.

comment:5 by Daniel James, 15 years ago

Component: functionalhash

comment:6 by Thomas Witt, 15 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.