Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build errors on Yosemite version of clang #3219

Closed
larkost opened this issue Oct 21, 2014 · 3 comments
Closed

build errors on Yosemite version of clang #3219

larkost opened this issue Oct 21, 2014 · 3 comments
Assignees
Milestone

Comments

@larkost
Copy link
Collaborator

larkost commented Oct 21, 2014

There was a post-Yosemite upgrade of Xcode that carried with it a new version of clang, and it seems it finds new problems in our codebase:

In file included from src/rdb_protocol/geo/indexing.cc:18:
In file included from ./src/rdb_protocol/geo/s2/strings/strutil.h:44:
./src/rdb_protocol/geo/s2/util/endian/endian.h:175:9: error: 'htonll' macro redefined [-Werror]
#define htonll(x) ghtonll(x)
        ^
/usr/include/sys/_endian.h:141:9: note: previous definition is here
#define htonll(x)       __DARWIN_OSSwapInt64(x)
        ^
In file included from src/rdb_protocol/geo/indexing.cc:18:
In file included from ./src/rdb_protocol/geo/s2/strings/strutil.h:44:
./src/rdb_protocol/geo/s2/util/endian/endian.h:182:9: error: 'ntohll' macro redefined [-Werror]
#define ntohll(x) htonll(x)
        ^
/usr/include/sys/_endian.h:140:9: note: previous definition is here
#define ntohll(x)       __DARWIN_OSSwapInt64(x)
        ^

I am unable to build next on my local machine, but gantz (Mavericks) is building the same version fine. For reference the versions of clang:

Mavericks: Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Yosemite: Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)

(yes... new build of the same "version")

@AtnNn
Copy link
Member

AtnNn commented Oct 21, 2014

The problem seems to be that the system include files (specifically /usr/include/sys/_endian.h) now define those two macros while previous versions didn't.

Those macros are defined in the s2 code, but don't seem to be used anywhere. We could wrap them in an #ifdef or just remove them.

@danielmewes
Copy link
Member

(So far I've usually removed platform-specific parts of S2 that were not used.)

@danielmewes danielmewes added this to the 1.16 milestone Oct 23, 2014
larkost added a commit that referenced this issue Oct 23, 2014
@larkost larkost self-assigned this Oct 23, 2014
@larkost
Copy link
Collaborator Author

larkost commented Oct 23, 2014

I fixed this by putting in ifdefs around the two problematic declarations. That appears to solve the problem. It is in next with ea2c2d7, and was over-the-shouldered by @danielmewes

@larkost larkost closed this as completed Oct 23, 2014
larkost added a commit that referenced this issue Oct 28, 2014
larkost added a commit that referenced this issue Nov 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants