Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in

Issue 193074: Fix errors and warnings from g++-4.4.1

Can't Edit
Can't Publish+Mail
Start Review
14 years, 3 months ago by Chris Foster
9 years, 4 months ago
Base URL:


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 :-/ - failing to check the return value of fgets() - a probable operator precedence bug - && has higher precedence than || and gcc warns about a suspicious usage (hopefully I guessed right about the intention here!) - a dangling else ambiguity (not a bug, just suspicious) - warnings about uninitialized values

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -18 lines) Patch
liboslcomp/oslcomp.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
liboslcomp/osllex.l View 1 chunk +1 line, -1 line 0 comments Download
liboslcomp/symtab.h View 2 chunks +11 lines, -11 lines 0 comments Download
liboslexec/bsdf_cloth.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
liboslexec/dual.h View 1 chunk +2 lines, -0 lines 0 comments Download
oslc/oslcmain.cpp View 1 chunk +1 line, -0 lines 0 comments Download
oslinfo/oslinfo.cpp View 2 chunks +2 lines, -1 line 0 comments Download


Total messages: 3
Chris Foster
14 years, 3 months ago (2010-01-24 05:01:28 UTC) #1
On Jan 23, 2010, at 9:01 PM, chris42f@gmail.com wrote: > Reviewers: osl-dev_googlegroups.com, > > Description: ...
14 years, 3 months ago (2010-01-24 08:26:12 UTC) #2
Chris Foster
14 years, 3 months ago (2010-01-24 09:28:31 UTC) #3
On 2010/01/24 08:26:12, blair wrote:
> 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

IMHO this seems to be a bit of overkill, and my preferred option would be just
to specify that >=boost-1.36 was necessary.  However I know that may not be an
option for everyone so I'll let the OSL core developers chime in.  What's the
story guys?

I'll note that using hash_map *does* compile with g++-4.4.1, but not without
warnings (and hence doesn't compile when using -Werror which is turned on by
default in the build scripts).

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

The M4 would have to be converted to cmake, but it's good to see all the
potential places which hash_map may reside.  Gosh there's a lot!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b