Thanks for confirmation. I've removed it from the code and logged it.
I haven't done ``-Wall'' yet.

Z.

On Wed, Dec 7, 2011 at 6:23 PM, Harshad Prabhu (hprabhu)
<hpra...@cisco.com> wrote:
>
>
>>-----Original Message-----
>>From: Zdenek Styblik [mailto:zdenek.styb...@gmail.com]
>>Sent: Wednesday, December 07, 2011 6:17 PM
>>To: ipmitool-devel
>>Subject: [Ipmitool-devel] Unused variable in 'lib/ipmi_chassis.c'
>>
>>Hey,
>>
>>I'm looking at 'lib/ipmi_chassis.c' and there seems to be an unused
>>variable on line 1143, or am I just wrong and blind?
>>
>>Part of the code in question is pasted bellow. Variable in question is
>>"i". And "op" resp. "struct options" has field "i". Thus I assume
>>variable "i" is not used anywhere.
>>
>>~~~ 'lib/ipmi_chassis.c' ~~~
>>            while (token != NULL) {
>>               int i; /* HERE */
>>
>>               if (strcmp(token, "help") == 0) {
>>                  optionError = 1;
>>                  break;
>>               }
>>               for (op = options; op->name != NULL; ++op) {
>>                  if (strcmp(token, op->name) == 0) {
>>                        flags[op->i] &= op->mask;
>>                        flags[op->i] |= op->value;
>>                        break;
>>                  }
>>               }
>>               if (op->name == NULL) {
>>                  /* Option not found */
>>                  optionError = 1;
>>                  lprintf(LOG_ERR, "Invalid option: %s", token);
>>               }
>>               token = strtok_r(NULL, ",", &saveptr);
>>            }
>>~~~ 'lib/ipmi_chassis.c' ~~~
>
> Yes its unused variable. If we give "-Wall" during compilation then we
> get these many different errors and tons more in other files :-))
>
> if /bin/sh ../libtool --silent --tag=CC --mode=compile gcc -Wall
> -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -fno-strict-aliasing
> -MT ipmi_chassis.lo -MD -MP -MF ".deps/ipmi_chassis.Tpo" -c -o
> ipmi_chassis.lo ipmi_chassis.c; \
>        then mv -f ".deps/ipmi_chassis.Tpo" ".deps/ipmi_chassis.Plo";
> else rm -f ".deps/ipmi_chassis.Tpo"; exit 1; fi
> ipmi_chassis.c: In function 'ipmi_chassis_poh':
> ipmi_chassis.c:226: warning: format '%li' expects type 'long int', but
> argument 2 has type 'uint32_t'
> ipmi_chassis.c:226: warning: format '%li' expects type 'long int', but
> argument 3 has type 'uint32_t'
> ipmi_chassis.c:228: warning: format '%li' expects type 'long int', but
> argument 2 has type 'uint32_t'
> ipmi_chassis.c:228: warning: format '%li' expects type 'long int', but
> argument 3 has type 'uint32_t'
> ipmi_chassis.c: In function 'ipmi_chassis_get_bootparam':
> ipmi_chassis.c:717: warning: format '%08X' expects type 'unsigned int',
> but argument 2 has type 'long unsigned int'
> ipmi_chassis.c:720: warning: format '%08X' expects type 'unsigned int',
> but argument 2 has type 'long unsigned int'
> ipmi_chassis.c:724: warning: format '%08X' expects type 'unsigned int',
> but argument 2 has type 'long unsigned int'
> ipmi_chassis.c: In function 'ipmi_chassis_main':
> ipmi_chassis.c:1143: warning: unused variable 'i'
>
>>
>>Thanks,
>>Z.
>>
>>-----------------------------------------------------------------------
> -
>>------
>>Cloud Services Checklist: Pricing and Packaging Optimization
>>This white paper is intended to serve as a reference, checklist and
>>point of
>>discussion for anyone considering optimizing the pricing and packaging
>>model
>>of a cloud services business. Read Now!
>>http://www.accelacomm.com/jaw/sfnl/114/51491232/
>>_______________________________________________
>>Ipmitool-devel mailing list
>>Ipmitool-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to