Re: Fix errors and warnings from g++-4.4.1 (issue193074)


Blair Zajac <bl...@...>
 

On Jan 23, 2010, at 9:01 PM, chri...@... wrote:

Reviewers: osl-dev_googlegroups.com,

Description:
Several additional warnings and some new errors occur when trying to
compile OSL using g++-4.4.1.

Errors were due to:
- header rearrangements which cause strcmp() and exit() to be
unavaliable without additional includes
- strchr (const char*, char) returns const char*

The warnings are various:
- hash_map is deprecated. The obvious alternative is to use
unordered_map from boost, but it's only avaliable after boost-1.36, so
not sure if my fix will work at SPI :-/
You could do what Google Protocol Buffers does and determine which hash map to use at configure time. It works with g++ 3.4.x all the way up to 4.4.x. See the m4 file at:

http://code.google.com/p/protobuf/source/browse/trunk/m4/stl_hash.m4

Protocol Buffers has a new BSD license so this could be copied straight from them.

Running configure on my Ubuntu Karmic system with g++ 4.4.1 shows

checking the location of hash_map... <tr1/unordered_map>

Regards,
Blair

Join {osl-dev@lists.aswf.io to automatically receive all group messages.