NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/51777: src/sys/fs/udf/udf_allocation.c:1004]: (style) Variable 'offset' is modified but its new value is never used.



>Number:         51777
>Category:       kern
>Synopsis:       src/sys/fs/udf/udf_allocation.c:1004]: (style) Variable 'offset' is modified but its new value is never used.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 04 09:55:00 +0000 2017
>Originator:     David Binderman
>Release:        cvs-20161231
>Organization:
>Environment:
>Description:

Source code is

    while (to_trunc > 0) {
        seq_free++;
        bitval = (1 << bit);
        if (!(*bpos & bitval))
            seq_free = 0;
        offset++; to_trunc--;
        bit++;
        if (bit == 8) {
            bpos++;
            bit = 0;
        }
    }


Suggest either use the local variable or delete it.

Also in the same file:

[src/sys/fs/udf/udf_allocation.c:917]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.
[src/sys/fs/udf/udf_allocation.c:917]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[src/sys/fs/udf/udf_allocation.c:1909]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/sys/fs/udf/udf_allocation.c:2131]: (warning) %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'.
[src/sys/fs/udf/udf_allocation.c:2342]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.

Might be worth fixing while editing the file.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index