ext/stl_hashtable.h:313 - computed value not used + question regarding __gnu_cxx
Paolo Carlini
pcarlini@unitus.it
Mon Mar 18 10:46:00 GMT 2002
Hi,
> I get warnings from including ext/hash_map extended stl libraries.. the
> warning occurs in ext/stl_hashtable.h:313
Can you please be more specific (i.e., code snippet triggering the warning, 3.1
snapshot you are testing, etc.) ??
With 3.1 20020317 I can compile -Wall -Werror the example below with no warnings
at all.
Thanks,
Paolo.
///////////////
#include <ext/hash_map>
#include <iostream>
using namespace __gnu_cxx;
using namespace std;
struct eqstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2) == 0;
}
};
int main()
{
hash_map<const char*, int, hash<const char*>, eqstr> months;
months["january"] = 31;
months["february"] = 28;
months["march"] = 31;
months["april"] = 30;
months["may"] = 31;
months["june"] = 30;
months["july"] = 31;
months["august"] = 31;
months["september"] = 30;
months["october"] = 31;
months["november"] = 30;
months["december"] = 31;
cout << "september -> " << months["september"] << endl;
cout << "april -> " << months["april"] << endl;
cout << "june -> " << months["june"] << endl;
cout << "november -> " << months["november"] << endl;
}
More information about the Gcc-help
mailing list