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

32-bit compilation #53

Closed
miloyip opened this issue Apr 17, 2015 · 2 comments
Closed

32-bit compilation #53

miloyip opened this issue Apr 17, 2015 · 2 comments
Milestone

Comments

@miloyip
Copy link

miloyip commented Apr 17, 2015

When compiling the library on a 32-bit target, it generates this static assert.

../../thirdparty/json-voorhees/src/jsonv/value.cpp:356:5: error: static_assert
      failed "!!"
    static_assert(sizeof _data == sizeof _data.object, "!!");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am not sure if this library supports 32-bit architecture. It was compiled successfully on 64-bit in the same platform (OS X).

@neomantra
Copy link

I came upon this bug from using nativejson-benchmark (strangely hours after @miloyip 's push). I can duplicate this with 32-bit builds on Ubuntu Linux 14.04, gcc 4.8.2. It builds fine on 64-bit.

Simple steps to reproduce outside of nativejson-benchmark:

# I needed to do this first to find my boost installation,
# because I'm on a 64-bit system cross-compiling to 32-bit?
cmake .
# re-cmake with 32-bit settings
cmake -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32 .
make

I get the following errors and warning:

/home/nm/foo/json-voorhees/src/jsonv/value.cpp: In member function ‘void jsonv::value::swap(jsonv::value&)’:
/home/nm/foo/json-voorhees/src/jsonv/value.cpp:356:5: error: static assertion failed: !!
     static_assert(sizeof _data == sizeof _data.object, "!!");
     ^
/home/nm/foo/json-voorhees/src/jsonv/value.cpp: In member function ‘std::size_t std::hash<jsonv::value>::operator()(const jsonv::value&) const’:
/home/nm/foo/json-voorhees/src/jsonv/value.cpp:635:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
         return 0x51afb2fe9467d0f7ULL;
                ^
make[2]: *** [CMakeFiles/jsonv.dir/src/jsonv/value.cpp.o] Error 1
make[1]: *** [CMakeFiles/jsonv.dir/all] Error 2
make: *** [all] Error 2

Unrelated to 32-bit (maybe should be another issue)... When running the test suite in 64-bit builds, I get the following error. I'm running it without arguments from the base directory. From strace, I do see it is finding its first test numbers_coerce.json.

terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted (core dumped)

@tgockel
Copy link
Owner

tgockel commented Apr 17, 2015

Yeah, I can't say I have tested this on anything 32-bit. I'll look into fixing this sometime soon.

@tgockel tgockel modified the milestone: v1.1 Apr 17, 2015
@tgockel tgockel closed this as completed Jul 25, 2015
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