Issue 50 in google-sparsehash: Source won't compile on Unix systems

6 views
Skip to first unread message

google-s...@googlecode.com

unread,
Dec 24, 2009, 12:56:12 PM12/24/09
to google-s...@googlegroups.com
Status: New
Owner: ----

New issue 50 by shiranpasternak: Source won't compile on Unix systems
http://code.google.com/p/google-sparsehash/issues/detail?id=50

What steps will reproduce the problem?
1. Check out revision 46 from trunk
2. Run ./configure
3. Run make

What is the expected output? What do you see instead?
Got the following error:
./src/google/sparsehash/sparsehashtable.h: In member function `void
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey,
Alloc>::move_from(google::sparse_hashtable<Value, Key, HashFcn, ExtractKey,
SetKey, EqualKey,
Alloc>::MoveDontCopyT, google::sparse_hashtable<Value, Key, HashFcn,
ExtractKey, SetKey,
EqualKey, Alloc>&, size_t) [with Value = std::pair<const std::string,
std::string>, Key =
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey,
SetKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey
=
std::equal_to<std::string>, Alloc = std::allocator<std::string>]':
./src/google/sparsehash/sparsehashtable.h:738: instantiated from
`google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey,
Alloc>::sparse_hashtable(google::sparse_hashtable<Value, Key, HashFcn,
ExtractKey, SetKey,
EqualKey, Alloc>::MoveDontCopyT, google::sparse_hashtable<Value, Key,
HashFcn, ExtractKey,
SetKey, EqualKey, Alloc>&, size_t) [with Value = std::pair<const
std::string, std::string>, Key =
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey,
SetKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey
=
std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparsehash/sparsehashtable.h:435: instantiated from `void
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey,
Alloc>::squash_deleted() [with Value = std::pair<const std::string,
std::string>, Key = std::string,
HashFcn = __gnu_cxx::hash<std::string>, ExtractKey =
google::sparse_hash_map<std::string,
std::string, __gnu_cxx::hash<std::string>, std::equal_to<std::string>,
std::allocator<std::string>
> ::SelectKey, SetKey = google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>, std::equal_to<std::string>,
std::allocator<std::string> >::SetKey,
EqualKey = std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparsehash/sparsehashtable.h:444: instantiated from `void
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey,
Alloc>::set_deleted_key(const Key&) [with Value = std::pair<const
std::string, std::string>, Key =
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey,
SetKey =
google::sparse_hash_map<std::string, std::string,
__gnu_cxx::hash<std::string>,
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey
=
std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparse_hash_map:269: instantiated from `void
google::sparse_hash_map<Key, T,
HashFcn, EqualKey, Alloc>::set_deleted_key(const typename
google::sparse_hashtable<std::pair<const _Key, _Tp>, Key, HashFcn,
google::sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>::SelectKey,
google::sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>::SetKey, EqualKey,
Alloc>::key_type&) [with Key = std::string, T = std::string, HashFcn =
__gnu_cxx::hash<std::string>, EqualKey = std::equal_to<std::string>, Alloc =
std::allocator<std::string>]'
src/hashtable_unittest.cc:1084: instantiated from here
./src/google/sparsehash/sparsehashtable.h:654: error: no match for call to
`(__gnu_cxx::hash<std::string>) (const std::basic_string<char,
std::char_traits<char>,
std::allocator<char> >&)'
make[1]: *** [hashtable_unittest.o] Error 1

What version of the product are you using? On what operating system?
Tried it on 2 operating systems:
* Red Hat Enterprise Linux WS release 4 (Nahant Update 3)
* OpenSolaris 2008.11 snv_101b_rc2 X86

Please provide any additional information below.
When I roll back to revision 44, everything works fine.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

google-s...@googlecode.com

unread,
Dec 25, 2009, 2:27:17 PM12/25/09
to google-s...@googlegroups.com
Updates:
Status: Accepted
Labels: Type-Defect Priority-Medium

Comment #1 on issue 50 by csilvers: Source won't compile on Unix systems
http://code.google.com/p/google-sparsehash/issues/detail?id=50

Weird, I thought I had compiled the unittest before I submitted the last SVN
revision, but maybe not. It does look like I did an incomplete job of
adding StrHash
as the hash function template-parameter everywhere I was hashing a string.

I believe the fix is to just change
sparse_hash_map<string, XXX>
to
sparse_hash_map<string, XXX, StrHash>
and likewise with dense_hash_map. We also need to change
sparse_hash_map<char*, XXX>
if any of those occur.

I'll take care of it after I'm back from vacation. If you'd like to do the
patch
earlier than that, feel free, and can attach it here!

google-s...@googlecode.com

unread,
Dec 30, 2009, 9:00:44 PM12/30/09
to google-s...@googlegroups.com
Updates:
Status: Started

Comment #2 on issue 50 by csilvers: Source won't compile on Unix systems
http://code.google.com/p/google-sparsehash/issues/detail?id=50

I've got a fix that works for me, that I'm having reviewed right now. Once
it's been
ok'ed, I'll let you know. May be next year, though!

google-s...@googlecode.com

unread,
Jan 11, 2010, 6:40:58 PM1/11/10
to google-s...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 50 by csilvers: Source won't compile on Unix systems
http://code.google.com/p/google-sparsehash/issues/detail?id=50

This should be resolved in sparsehash 1.6, just released.

Reply all
Reply to author
Forward
0 new messages