Skip to contentSkip to conversation

: (error) Uninitialized variable: skip_state

U-Boot Wolfgang Denk 2 participants 4 messages Nov 6, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

cppcheck reports:

[net/eth.c:64]: (error) Uninitialized variable: skip_state

can you please have a look? Thanks!

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What we anticipate seldom occurs;  what  we  least  expect  generally
happens.                                          - Bengamin Disraeli
#1 lore raw
Quoted 7 lines · Wolfgang Denk

Hello,

cppcheck reports:

[net/eth.c:64]: (error) Uninitialized variable: skip_state

can you please have a look? Thanks!

Dense code, like cmd_ini.c my cppcheck is OK and looking at the code manually I think it's fine too:

        return ((skip_state = getenv(enetvar)) != NULL);
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141106/735805ac/attachment.pgp>
#2 lore raw

Dear Tom Rini,

Quoted 6 lines · In message <20141106164628.GR24724@bill-the-cat> you wrote:
Quoted 2 lines

[net/eth.c:64]: (error) Uninitialized variable: skip_state

Dense code, like cmd_ini.c my cppcheck is OK and looking at the code manually I think it's fine too:

        return ((skip_state = getenv(enetvar)) != NULL);

Looks OK to me, too, but recent versions of cppcheck spew this error.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"He was so narrow minded he could see through  a  keyhole  with  both
eyes ..."
#3 lore raw
Quoted 11 lines · Wolfgang Denk

Dear Tom Rini,

Quoted 6 lines · In message <20141106164628.GR24724@bill-the-cat> you wrote:
Quoted 2 lines

[net/eth.c:64]: (error) Uninitialized variable: skip_state

Dense code, like cmd_ini.c my cppcheck is OK and looking at the code manually I think it's fine too:

        return ((skip_state = getenv(enetvar)) != NULL);

Looks OK to me, too, but recent versions of cppcheck spew this error.

File a bug back with them then? I do like what cppcheck is doing 'tho, I poked some of the sandbox ones as well and they're real.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141106/1425dedb/attachment.pgp>