Project

General

Profile

Actions

Bug #13401

closed

eeprom: 'lv' may be used uninitialized in this function

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Build error with gcc 10:

    benv.c: In function 'add_pair':
    benv.c:754:22: error: 'lv' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      754 |   if (lv < INT16_MIN || lv > INT16_MAX)
    cc1: all warnings being treated as errors

Typo created by me. Compiler gags are bad.

Testing one:

root@test:/home/tsoome# eeprom -b -n illumos:nvstore -k test -t DATA_TYPE_INT16 -v 32768
error: Invalid argument
root@test:/home/tsoome# eeprom -b -n illumos:nvstore -k test -t DATA_TYPE_INT16 -v 32767
zfs bootenv is successfully written
root@test:/home/tsoome# 
root@test:/home/tsoome# eeprom -bp
nvlist version: 0
    version = 0x1
    illumos:nvstore = (embedded nvlist)
    nvlist version: 0
        help = not now
        test = 32767
    (end illumos:nvstore)

root@test:/home/tsoome# eeprom -b -n illumos:nvstore -k test -t DATA_TYPE_INT16 -v 32768
error: Invalid argument
root@test:/home/tsoome# eeprom -b -n illumos:nvstore -k test -t DATA_TYPE_INT16 -v -32768
zfs bootenv is successfully written
root@test:/home/tsoome# eeprom -b -n illumos:nvstore -k test -t DATA_TYPE_INT16 -v -32769
error: Invalid argument
root@test:/home/tsoome# eeprom -bp
nvlist version: 0
    version = 0x1
    illumos:nvstore = (embedded nvlist)
    nvlist version: 0
        help = not now
        test = -32768
    (end illumos:nvstore)

Actions

Also available in: Atom PDF