On 09/03/2009 08:02 PM, Mike Christie wrote: > > On 09/03/2009 11:21 AM, Erez Zilber wrote: >> Fix compilation warnings and modify the Makefiles to treat >> warnings as errors. >> >> Signed-off-by: Erez Zilber <erezzi.l...@gmail.com> >> > > > Thanks. > > > I get this compilation error on fedora 10. We used to get a warning about it > not being initialized and upstream we did this patch. Is this just a bug in > my compiler? > > > @@ -693,6 +692,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, > unsigned int target_id) > "Too many iscsi targets. Max > " > "number of targets is %d.\n", > ISCSI_MAX_TARGET - 1); > + err = -EOVERFLOW;
Better use the uninitialized_var() macro on declaration of variable. 1. It does not produce any code in shutting up the warning. 2. There is a scrip laying around that turns the macro off and looks for warning instances for every uninitialized_var use. So in the future this can be removed when the compilers we care about stop to complain. 3. Better Programmer's communication of what's up. Boaz > goto release_host; > } > } > > > make > make -C /lib/modules/2.6.29.4-167.fc11.x86_64/build M=`pwd` KBUILD_OUTPUT= > V=0 modules > make[1]: Entering directory `/usr/src/kernels/2.6.29.4-167.fc11.x86_64' > CC [M] > /home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.o > cc1: warnings being treated as errors > /home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.c: > In function ‘iscsi_add_session’: > /home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.c:678: > error: ‘err’ may be used uninitialized in this function > make[2]: *** > [/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel/scsi_transport_iscsi.o] > Error 1 > make[1]: *** > [_module_/home/mnc/kernel/iscsi/open-iscsi/devel/open-iscsi/kernel] Error 2 > make[1]: Leaving directory `/usr/src/kernels/2.6.29.4-167.fc11.x86_64' > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~----------~----~----~----~------~----~------~--~---