cext will only compile if warnings are lenient.#121
cext will only compile if warnings are lenient.#121dekellum wants to merge 1 commit intojruby:jruby-1_6from
Conversation
Otherwise:
[exec] /home/david/src/jruby/cext/src/thread.cpp: In function ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’:
[exec] /home/david/src/jruby/cext/src/thread.cpp:92:26: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
[exec] cc1plus: all warnings being treated as errors
[exec]
[exec] make[1]: *** [/home/david/src/jruby/cext/src/../..//build/thread.o] Error 1
[exec] make[1]: Leaving directory `/home/david/src/jruby/cext/src'
[exec] make: *** [all] Error 2
On:
Fedora 16 (x64)
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)
|
I will look into it sometime this week. I am reluctant to disable -Werror because it helps catch quite a few sources of possible SEGV and I don't want to risk us shipping C ext libs in a release that have these problems. |
|
I had submitted a patch for this in Jira (http://jira.codehaus.org/browse/JRUBY-6378?focusedCommentId=290224&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-290224), but it'd be good if someone with more C++ than me could review the patch. |
|
Okay @tychobrailleur, you have a commit in JRuby master now :) @dekellum, can you please confirm that it now works for you? |
|
Thanks @timfel. I take it reinterpret_cast in that instance is ok, then? |
|
Well, it works, and I'm pretty sure 32-bit ints will always fit into whatever any JRuby supported system's ptr size is, so yeah, let's consider ourselves smarter than our compiler and just go with it ;) |
|
And @tychobrailleur's C++ patch does, now that I've had a chance to look, work for me as well. Thanks! |
I don't understand the cext code itself well enough to fix this warning directly, but compiling without -Werror allows the build to succeed and everything appears to work correctly.
Otherwise:
On:
Fedora 16 (x64)
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)