teris / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

Error compiling on OS X 10.6 #113

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've tried to compile latest git version on OS X 10.6 (g++ v4.2.1)
and I got following errors:

./src/sync/../../lib/rapidjson/internal/itoa.h:153: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:175: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:177: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:179: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:181: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:183: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:185: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:202: error: integer constant is 
too large for 'long' type
./src/sync/../../lib/rapidjson/internal/itoa.h:203: error: integer constant is 
too large for 'long' type

Basically, when you use large integer constants, they should be marked as 
having a correct type. For example first error line:

else if (value < 10000000000000000) {

should be fixed as:

else if (value < 10000000000000000ULL) {

adding ULL (unsigned long long) suffix.

Original issue reported on code.google.com by helix.sp...@gmail.com on 31 Jul 2014 at 10:37

GoogleCodeExporter commented 8 years ago
Thank you for reporting.
But can you use GitHub for creating new issue?

Original comment by milo...@gmail.com on 31 Jul 2014 at 11:17

GoogleCodeExporter commented 8 years ago
Fixed. Using UINT64_C() macro is more compatible among compilers.
https://github.com/miloyip/rapidjson/commit/2f9544620b09e13aa47fbdaeaa2760a4604a
8da4

Original comment by milo...@gmail.com on 31 Jul 2014 at 4:38

GoogleCodeExporter commented 8 years ago
> But can you use GitHub for creating new issue?

Sorry, I though that you just hosted code there and kept using this as issue 
tracker.

Original comment by helix.sp...@gmail.com on 1 Aug 2014 at 6:09

GoogleCodeExporter commented 8 years ago
Besides, I have a proposal for better compatibility. 
https://github.com/miloyip/rapidjson/issues/94

It is open for comment.

Original comment by milo...@gmail.com on 1 Aug 2014 at 6:32