Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium
New issue 407 by whatmann...@gmail.com: Build fail with clang on OS X
http://code.google.com/p/protobuf/issues/detail?id=407
What steps will reproduce the problem?
1. Try to build on OS X with clang
2. Build fails
What is the expected output? What do you see instead?
libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE
-Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
-mmacosx-version-min=10.5 -MT descriptor.lo -MD -MP
-MF .deps/descriptor.Tpo -c google/protobuf/descriptor.cc -fno-common
-DPIC -o .libs/descriptor.o
In file included from
google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:
In file included from ./google/protobuf/stubs/atomicops.h:173:
./google/protobuf/stubs/atomicops_internals_macosx.h:138:9: error: no
matching function for call to 'OSAtomicCompareAndSwap64'
if (OSAtomicCompareAndSwap64(old_value, new_value,
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/libkern/OSAtomic.h:476:9: note: candidate function not viable:
no known conversion from 'Atomic64 *' (aka 'long *') to 'volatile int64_t
*' (aka 'volatile long long *') for 3rd argument;
bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
volatile int64_t *__theValue );
^
and many more similar errors
What version of the product are you using? On what operating system?
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.0.0
Thread model: posix
Please provide any additional information below.
It builds if I make this change:
Index: src/google/protobuf/stubs/atomicops.h
===================================================================
--- src/google/protobuf/stubs/atomicops.h (revision 424)
+++ src/google/protobuf/stubs/atomicops.h (working copy)
@@ -71,7 +71,7 @@
// http://code.google.com/p/nativeclient/issues/detail?id=1162
typedef int64 Atomic64;
#else
-typedef intptr_t Atomic64;
+typedef int64 Atomic64;
#endif
#endif
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.