Bugzilla – Bug 154
2.5.8-snap.201108241142: Warnings and wrong ./configure help
Last modified: 2011-08-29 15:26:37 MDT
You need to log in before you can comment on or make changes to this bug.
That's with 2.5.8-snap.201108241142. a) ./configure --help is wrong. The help text has not been updated to reflect the new default. Cf. also quoted patch at: http://www.clusterresources.com/pipermail/torquedev/2011-August/003755.html Patch: --- configure.ac.orig 2011-08-25 14:29:56.000000000 +0200 +++ configure.ac 2011-08-25 14:31:59.000000000 +0200 @@ -287,8 +287,8 @@ fi dnl if using gcc, we can be very strict AC_ARG_ENABLE(gcc_warnings, [ - --disable-gcc-warnings Disable gcc strictness and warnings. If using - gcc, default is to error on any warning]) + --enable-gcc-warnings Enable GCC strict checking and error + on any warning]) if test "x$GCC" = "xyes" ;then AC_MSG_CHECKING([whether to use strict gcc warnings]) if test "${enable_gcc_warnings}" == "yes" ; then b) Using a very recent GCC (4.7-experimental, though 4.6 should be similar), I get the following "unused-but-set-variable" warnings. (By the way, I do not get alias warnings, which were mentioned on the mailing list.) ../Libifl/dec_attrl.c: In function 'decode_DIS_attrl': ../Libifl/dec_attrl.c:116:17: error: variable 'name_len' set but not used [-Werror=unused-but-set-variable] ../Libifl/dec_attropl.c: In function 'decode_DIS_attropl': ../Libifl/dec_attropl.c:116:17: error: variable 'name_len' set but not used [-Werror=unused-but-set-variable] Both are: name_len = disrui(sock, &rc); /* name_len is unused here */ How about changing it to something like: (void) disrui(sock, &rc); /* Returned name_len is unused here */ ../Libnet/net_client.c: In function 'await_connect': ../Libnet/net_client.c:181:7: error: variable 'MaxNumDescriptors' set but not used [-Werror=unused-but-set-variable] Here, the function call can be elminiated completely. ../Libnet/rm.c: In function 'activereq': ../Libnet/rm.c:1056:7: error: variable 'MaxNumDescriptors' set but not used [-Werror=unused-but-set-variable] In this case, it can be moved into the #else branch of #if RPP. And in src/lib/Libutils: u_threadpool.c: In function ‘work_thread’: u_threadpool.c:203:17: error: variable ‘expired’ set but not used [-Werror=unused-but-set-variable] Simply set to TRUE/FALSE but not used. In src/server: job_func.c: In function ‘job_clone_wt’: job_func.c:950:21: error: variable ‘new_task’ set but not used [-Werror=unused-but-set-variable] Casting return value to (void)? pbsd_init.c: In function ‘pbsd_init’: pbsd_init.c:466:21: error: variable ‘wt’ set but not used [-Werror=unused-but-set-variable] Ditto. req_getcred.c: In function ‘unmunge_request’: req_getcred.c:221:11: error: variable ‘newfd’ set but not used [-Werror=unused-but-set-variable] Seemingly not used at all. req_jobobit.c: In function ‘req_jobobit’: req_jobobit.c:2240:10: error: variable ‘have_resc_used’ set but not used [-Werror=unused-but-set-variable] Move into #ifdef USESAVEDRESOURCES req_modify.c: In function ‘chkpt_xfr_hold’: req_modify.c:298:21: error: variable ‘ptasknew’ set but not used [-Werror=unused-but-set-variable] Cast return value of set_test to (void)? req_modify.c: In function ‘chkpt_xfr_done’: req_modify.c:338:14: error: variable ‘pjob’ set but not used [-Werror=unused-but-set-variable] Dead code? req_modify.c: In function ‘chkpt_xfr_done’: req_modify.c:337:25: error: variable ‘preq’ set but not used [-Werror=unused-but-set-variable] Ditto. req_register.c: In function ‘encode_depend’: req_register.c:2425:9: error: variable ‘BSpace’ set but not used [-Werror=unused-but-set-variable] Again: Dead code. req_stat.c: In function ‘req_stat_job_step2’: req_stat.c:353:25: error: variable ‘IsTruncated’ set but not used [-Werror=unused-but-set-variable] Dead code. stat_job.c: In function ‘status_attrib’: stat_job.c:306:25: error: variable ‘upperBound’ set but not used [-Werror=unused-but-set-variable] Dead code. svr_jobfunc.c: In function ‘chk_svr_resc_limit’: svr_jobfunc.c:962:24: error: variable ‘gpuresc’ set but not used [-Werror=unused-but-set-variable] Dead code (You might want to comment it instead of deleting). mom_mach.c: In function ‘overcpu_proc’: mom_mach.c:885:10: error: variable ‘memsize’ set but not used [-Werror=unused-but-set-variable] mom_mach.c: In function ‘overmem_proc’: mom_mach.c:1031:22: error: variable ‘memsize’ set but not used [-Werror=unused-but-set-variable] Dead code. In src/resmom: requests.c: In function ‘del_files’: requests.c:2583:9: error: variable ‘del_dir’ set but not used [-Werror=unused-but-set-variable] Dead code. (There is a "/* if(del_dir) */" ...) requests.c: In function ‘req_returnfiles’: requests.c:3004:7: error: variable ‘rc’ set but not used [-Werror=unused-but-set-variable] Check the value of "rc", returned by return_file? requests.c: In function ‘req_cpyfile’: requests.c:3692:13: error: variable ‘path_changed’ set but not used [-Werror=unused-but-set-variable] (unclear to me - cast return value to void?) Further issues: checkpoint.c: In function ‘mom_checkpoint_job’: checkpoint.c:1206:8: error: variable ‘filelen’ set but not used [-Werror=unused-but-set-variable] start_exec.c: In function ‘TMomFinalizeJob1’: start_exec.c:1449:22: error: variable ‘presc’ set but not used [-Werror=unused-but-set-variable] start_exec.c: In function ‘TMomFinalizeJob2’: start_exec.c:1886:24: error: variable ‘ptask’ set but not used [-Werror=unused-but-set-variable] iff2.c: In function ‘main’: iff2.c:153:7: error: variable ‘PBSLOGLEVEL’ set but not used [-Werror=unused-but-set-variable] qsub.c: In function ‘process_opts’: qsub.c:2978:15: error: variable ‘PBSPort’ set but not used [-Werror=unused-but-set-variable] qstat.c: In function ‘main’: qstat.c:2523:9: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
Could you create a separate bug for the compiler warnings. Setting gcc-warnings as disabled by default has been fixed in torque-2.5.8-snap.201108261600.tar.gz.
(In reply to comment #1) > Could you create a separate bug for the compiler warnings. I will do so. > Setting gcc-warnings as disabled by default has been fixed in > torque-2.5.8-snap.201108261600.tar.gz. This does not seem to be the case for http://www.clusterresources.com/downloads/torque/snapshots/torque-2.5.8-snap.201108261600.tar.gz ./configure --help still shows a partially wrong result: --enable-gcc-warnings Enable gcc strictness and warnings. If using gcc, default is to error on any warning That is: The --enable part is now correct, but the comment afterwards does not seem to reflect configure{,.ac}: Contrary to the description, the strict checking is not enabled by default when compiling with GCC but only when one uses both the flag *and* GCC, see: if test "x$GCC" = "xyes" ;then AC_MSG_CHECKING([whether to use strict gcc warnings]) if test "${enable_gcc_warnings}" == "yes" ; then ... else AC_MSG_RESULT([no]) fi fi
(In reply to comment #2) > > ./configure --help still shows a partially wrong result: > > --enable-gcc-warnings Enable gcc strictness and warnings. If using > gcc, default is to error on any warning > Fixed in http://www.clusterresources.com/downloads/torque/snapshots/torque-2.5.8-snap.201108291517.tar.gz Message now reads --enable-gcc-warnings Enable gcc strictness and warnings. If using gcc, default is to not error on any warning