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

GCC 4.7.2-5 doesn't like implicit conversion of unsigned to signed types #93

Open
GoogleCodeExporter opened this issue May 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

To make rapidjson compile cleanly with our warning flags, I had to make this 
trivial change:
Index: include/rapidjson/writer.h
===================================================================
--- include/rapidjson/writer.h  (revision 131)
+++ include/rapidjson/writer.h  (working copy)
@@ -129,7 +129,7 @@ class Writer {
                char buffer[10];
                char *p = buffer;
                do {
-                       *p++ = (u % 10) + '0';
+                       *p++ = char((u % 10) + '0');
                        u /= 10;
                } while (u > 0);

@@ -151,7 +151,7 @@ class Writer {
                char buffer[20];
                char *p = buffer;
                do {
-                       *p++ = char(u64 % 10) + '0';
+                       *p++ = char(char(u64 % 10) + '0');
                        u64 /= 10;
                } while (u64 > 0);


Original issue reported on code.google.com by [email protected] on 28 Oct 2013 at 5:00

@GoogleCodeExporter
Copy link
Author

May I know what is your warning flags settings?
After some efforts, the master branch at https://github.com/miloyip/rapidjson 
can be compiled with -Wall -Wextra -Weffc++ -Wswitch-default
Can you verify it in your environment?
Thank you.

Original comment by [email protected] on 13 Jul 2014 at 4:42

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant