-
Notifications
You must be signed in to change notification settings - Fork 556
Fix more C warnings #628
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
Fix more C warnings #628
Conversation
This fails to compile on OS X for me, due to a "Default label in switch which covers all enumeration values" warning. Even if we added a -Wno-error for that, I think -Weverything is too noisy to ship to end-users. |
I kind of like having to explicitly list which warnings we do not comply with and the reasons we do not. EDIT: Can you supply the exact error and its location? |
Two case blocks for MySQL return types in result.c:
|
Oh, you must be compiling against a different version of the mysql header - on my system, those enumerations do not fully cover all values, so the warning is not issued. Which mysql are you compiling against? |
MySQL 5.5 -- of course we support compiling against a range of versions, so the default is an important fallback :) Really my main concern is that all of the warning text cannot be printed to end users while they are compiling. There will be tons of tickets about how mysql2 doesn't compile cleanly, is it going to work? I haven't tried it but I'm nervous!? |
Ah, turns out we can kill the warnings entirely with |
The next issue is thornier. There are a number of shortenings ala 1 - http://rxr.whitequark.org/mri/source/include/ruby/ruby.h#927
|
Neat. Where did you find a 32bit machine? :) PTAL |
Oddly, this is on my desktop Mac - it's 64-bit and compiled as such - so I'm confused, too! In result.h, numberOfRows is an unsigned long, which certainly should be 64-bit. |
These failures look spurious, can you retry the build? I've changed numberOfRows and numberOfFields to both be my_ulonglong, so perhaps the error you saw is cleared? |
I think #629 satisfies most of the goals of this PR but with less ambitious compiler warnings. Let me know if there are items in this branch you would still hope to see land, or consider it resolved and close the PR. |
Turns out there was a bug in how CFLAGS were being added in extconf; fixing it made '-Weverything' actually turn on, and a bunch of issues were revealed.