Compile errors with clang/C++11


I was redirected to this forum from the support email.
I get compile errors on OS X when using clang with the -std=c++11 compile flag.

Its complaining about the use of 0xFFFFFFFF in enums which exceed the an int.
Changing them to 0x7FFFFFFF fixes the compile problem.

It seems there is no way to attach a patch file here as there was to the support email…


And here is one of the compile errors if you wanted to know:

opennurbs/opennurbs_defines.cpp:1890:8: error: case value evaluates to 4294967295, which cannot be narrowed to type ‘int’ [-Wc++11-narrowing]
case os_all_snaps: osm = os_all_snaps; break;
1 error generated.

Hi Clinton,

Here is the list of supposed C++ compilers:

As you can see, clang isn’t on this list. But, with some effort, you would be able to make it work.

– Dale

Yes, it already worked with clang. And with the addition of the -std=c++11 compile flag, I got some errors, and I fixed them on my side. I already have a patch file.

I’m stuck trying to get the patch file into someone’s hands so that it can be included upstream.

I hope I’m more clear this time.

I wouldn’t fix this by changing enum values, but rather by adjusting the enum base type.

That sounds good. Any idea where I can give an updated patch?

Hi Clinton,

We don’t support the clang compiler. So I’m not sure what we’d do with the patch.

From here

I see that you do support clang. Clang is the compiler used under Apple Xcode 4.6.3. I’m just adding the -std=c++11 flag to that.

Ah yes, sorry about that. Feel free for forward the patch to me ( I have a feeling its already been addressed in the Rhino WIP code stream.


– Dale