Gecode / gecode

Generic Constraint Development Environment
https://www.gecode.org
Other
283 stars 76 forks source link

warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map> #53

Closed yurivict closed 5 years ago

yurivict commented 5 years ago

clang8 prints many warnings like this on FreeBSD 12:

In file included from ./gecode/flatzinc/lexer.lxx:54:
In file included from /usr/ports/devel/gecode/work/gecode-release-6.2.0/gecode/flatzinc/parser.hh:65:
In file included from /usr/ports/devel/gecode/work/gecode-release-6.2.0/gecode/flatzinc/symboltable.hh:42:
/usr/include/c++/v1/ext/hash_map:213:5: warning: Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map> [-W#warnings]
#   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
    ^
1 warning generated.
chschulte commented 5 years ago

This is really strange and should never occur: the configure checks whether unordered_map is available and this should automatically be used then.

@guidotack: can you have a look?

@yurivict: can you check whether the configure test for unordered_map is successful on your platform?

yurivict commented 5 years ago

can you check whether the configure test for unordered_map is successful on your platform?

"unordered_map" doesn't appear in the configure output.

chschulte commented 5 years ago

Would you mind trying the develop branch? Then the warnings should not be there…

Thanks & Cheers Christian

-- Christian Schulte, https://chschulte.github.io/ Professor of Computer Science Software and Computer Systems School of Electrical Engineering and Computer Science KTH Royal Institute of Technology, Sweden

From: yuri@FreeBSD notifications@github.com Sent: Tuesday, August 27, 2019 4:48 PM To: Gecode/gecode gecode@noreply.github.com Cc: Christian Schulte cschulte@kth.se; Comment comment@noreply.github.com Subject: Re: [Gecode/gecode] warning Use of the header <ext/hash_map> is deprecated. Migrate to (#53)

can you check whether the configure test for unordered_map is successful on your platform?

"unordered_map" doesn't appear in the configure output.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Gecode/gecode/issues/53?email_source=notifications&email_token=ADL6DBMWF7MBM5F6TS3FV6DQGU5BBA5CNFSM4IPIBZOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5H73AQ#issuecomment-525335938, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADL6DBLMZ7Z3LD3D6YMBX6TQGU5BBANCNFSM4IPIBZOA.

yurivict commented 5 years ago

Ok, thanks. I reported this so that they are fixed. If you fixed it please close the issue.

chschulte commented 5 years ago

This is weird, I just tried clang 6 and do not get the warnings. Could you send me the config.log file?

chschulte commented 5 years ago

Oh, BTW, this was fixed in 2014, that's why it is so weird.

yurivict commented 5 years ago

you should use clang 8 or 9. Also the STL lib could be different, the warning comes from it.

chschulte commented 5 years ago

Tried clang 8 on Ubuntu. No warnings. Without the config.log file this cannot be resolved as something will have gone wrong there. Hence I close it.

yurivict commented 5 years ago

I don't understand why don't you just remove the use of ext/hash_map and how can config.log help.

This C++ section causes the warning:


#if __DEPRECATED
#if defined(_LIBCPP_WARNING)
    _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>")
#else
#   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
#endif
#endif

It has been put their by the authors of the STL library, they presumably know what is deprecated.

chschulte commented 5 years ago

The thing is the following: I do not understand why this is picked up at all, the Gecode configure should have found that unordered_map is available which it didn’t. In that case hash_map would have never been looked at.

So something during configure went wrong. That’s why I want to look at the config.log.

-- Christian Schulte, https://chschulte.github.io/ Professor of Computer Science Software and Computer Systems School of Electrical Engineering and Computer Science KTH Royal Institute of Technology, Sweden

From: yuri@FreeBSD notifications@github.com Sent: Thursday, August 29, 2019 4:30 PM To: Gecode/gecode gecode@noreply.github.com Cc: Christian Schulte cschulte@kth.se; State change state_change@noreply.github.com Subject: Re: [Gecode/gecode] warning Use of the header <ext/hash_map> is deprecated. Migrate to (#53)

I don't understand why don't you just remove the use of ext/hash_map and how can config.log help.

This C++ section causes the warning:

if __DEPRECATED

if defined(_LIBCPP_WARNING)

_LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>")

else

warning Use of the header <ext/hash_map> is deprecated. Migrate to

endif

endif

It has been put their by the authors of the STL library, they presumably know what is deprecated.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/Gecode/gecode/issues/53?email_source=notifications&email_token=ADL6DBJNRJ7OF7WYFMJUFXLQG7MQBA5CNFSM4IPIBZOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OV2TQ#issuecomment-526212430, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADL6DBLA57VNED5Q5DHEAHLQG7MQBANCNFSM4IPIBZOA.

yurivict commented 5 years ago

https://people.freebsd.org/~yuri/gecode-config.log

chschulte commented 5 years ago

Oh, I see, thanks. I didn’t see that you are using cmake, the default way is using configure. I’ll have a look.

-- Christian Schulte, https://chschulte.github.io/ Professor of Computer Science Software and Computer Systems School of Electrical Engineering and Computer Science KTH Royal Institute of Technology, Sweden

From: yuri@FreeBSD notifications@github.com Sent: Thursday, August 29, 2019 4:49 PM To: Gecode/gecode gecode@noreply.github.com Cc: Christian Schulte cschulte@kth.se; State change state_change@noreply.github.com Subject: Re: [Gecode/gecode] warning Use of the header <ext/hash_map> is deprecated. Migrate to (#53)

https://people.freebsd.org/~yuri/gecode-config.log

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/Gecode/gecode/issues/53?email_source=notifications&email_token=ADL6DBOLS5G7HGS2MOOAXS3QG7OUXA5CNFSM4IPIBZOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OX3BY#issuecomment-526220679, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADL6DBKQQ7FI7D6FQZQBNNLQG7OUXANCNFSM4IPIBZOA.

chschulte commented 5 years ago

Done