On 07/24/2013 02:33 PM, Alan Bateman wrote: > On 10/07/2013 12:01, Omair Majid wrote: >> On 07/09/2013 03:40 AM, Erik Joelsson wrote: >>> I would like to see a comment explaining why the option was needed. Is >>> this a bug in gcc or has the checking just become better? >> -Werror is not a great default. It means "all warnings are errors". The >> set of warnings that a compiler emits changes all the time. Users and >> distributions can enable additional warnings by default. Newer compiler >> versions may omit additional warnings. So on any compiler other than the >> typical compiler used, extra warnings are possible. With -Werror, this >> will probably fail. Lots of people discourage it [1]. >> >> We have been setting SCTP_WERROR="" to disable this -Werror on Fedora >> builds [2]. >> > I'm curious if there was a conclusion on this one. I assume SCTP_WERROR > was originally intended for building libsctp (not libnio) so it would be > strange to add to SCTP_WERROR to disable -Werror for issues coming from > the file system code. One other thing that isn't clear is why there > aren't other warnings as there are many other JNI functions in this > source file that don't use the "jclass this" parameter.
I believe the original reporter made a mistake here. Only libsctp is being built with -Werror. My build logs shows messages like: /home/omajid/devel/jdk8-build-sctp-clean/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: In function ‘Java_sun_nio_fs_UnixNativeDispatcher_init’: /home/omajid/devel/jdk8-build-sctp-clean/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c:176:63: warning: unused parameter ‘this’ [-Wunused-parameter] Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this) This is just a warning. This part of the build is not using -Werror, so things continue on just fine. But when building libsctp, the message is different: /home/omajid/devel/jdk8-build-sctp-clean/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c: In function ‘JNI_OnLoad’: /home/omajid/devel/jdk8-build-sctp-clean/jdk/src/solaris/native/sun/nio/ch/sctp/SctpNet.c:47:12: error: unused parameter ‘vm’ [-Werror=unused-parameter] (JavaVM *vm, void *reserved) { ^ This is an error and causes the build to fail. Hope that clarifies things. I would still like to see this SCTP_WERROR be removed (or at least filtered with explicit -Werror=<list of known warnings to fail on>). Thanks, Omair -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681