Skip to content

"Error: Cannot take the address of a bit field." compile error on Solaris 11 Sparc #479

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

Closed
punchkicker opened this issue May 26, 2016 · 5 comments
Labels
build or testing cmake, meson, continuous integration, or testing related

Comments

@punchkicker
Copy link

punchkicker commented May 26, 2016

Hello.

I am trying to compile my project on a Solaris 11.3 sparc sun4v server. I am using the amalgamated source of Jsoncpp 1.7.2 (originally using v1.6.5, same error), with no changes. During compilation, I am getting this error:

"dist/jsoncpp.cpp", line 4630: Error: Cannot take the address of a bit field.

this line number maps to:

(4629) StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
(4630) : document_(NULL), rightMargin_(74), indentation_(indentation),
(4631) addChildValues_() {}

I am using the CC compiler found in Solaris Studio 12.4 (CC: Sun C++ 5.13 SunOS_sparc 151845-14 2016/03/28)

Here are the compile flags that I am using for jsoncpp.cpp:

CC -KPIC -m64 -std=c++11 -DSOLARIS -I. -I../src/include -I../src/include/platforms/solaris_SPARC64 -I dist -c dist/jsoncpp.cpp -o dist/jsoncpp.o

I have built this project successfully (using Jsoncpp 1.6.5) on Suse Linux (GCC compiler), Red Hat (GCC), and Windows (Visual Studio) and it works fine, but for some reason the Solaris build using the CC compiler is throwing this error. Any ideas? Anything I'm missing? Any more information I should include?

Thanks!

@cdunn2001
Copy link
Contributor

Could you tell us the version of the gcc compiler on Solaris? (gcc --version)

This seems similar to #411, where we managed to find a fix. If you could propose a fix, that would help. What we are doing is necessary for binary-compatibility and not a bug, but we have trouble explaining that to compilers.

@cdunn2001 cdunn2001 added the build or testing cmake, meson, continuous integration, or testing related label May 28, 2016
@punchkicker
Copy link
Author

I am actually not using the gcc compiler on Solaris, but the CC compiler. It is version Sun C++ 5.13 SunOS_sparc 151845-14 2016/03/28, and is included in Solaris Studio 12.4. Is jsoncpp only compatible with gcc?

@cdunn2001
Copy link
Contributor

We definitely want compatibility with as many compilers as possible, but we don't test on Solaris. If you can find a fix, please let us know. Otherwise, for the sake of binary-compatibility, this cannot be fixed cleanly until 2.0.

@punchkicker
Copy link
Author

thanks for the info. For the time being, I installed gcc 4.8 on my Solaris machine and it works fine now. I'll look into why the cc compiler wasn't working when I get some time.

@BillyDonahue
Copy link
Contributor

old and apparently fixed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build or testing cmake, meson, continuous integration, or testing related
Projects
None yet
Development

No branches or pull requests

3 participants