[Bug 206804] Inconsistent type handling for sizes in sbuf code

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 31 20:49:45 UTC 2016


--- Comment #4 from CTurt <cturt at hardenedbsd.org> ---
The error is:

error: format specifies type 'int' but the argument has type 'ssize_t' (aka
'long') [-Werror,-Wformat] ("attempt to create an sbuf of negative length
(%d)", length));

Referring to this line:

KASSERT(length >= 0,
            ("attempt to create an sbuf of negative length (%d)", length));

I find it odd that this would give an error, but the below line doesn't:

        KASSERT(s->s_len < s->s_size,
            ("wrote past end of sbuf (%d >= %d)", s->s_len, s->s_size));

Regardless, I've committed a new patch to use the `%zd` format specifier here,


You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list