svn commit: r328340 - in head/sys: fs/ext2fs ufs/ffs ufs/ufs

Bruce Evans brde at optusnet.com.au
Thu Jan 25 14:42:53 UTC 2018


On Wed, 24 Jan 2018, Pedro F. Giffuni wrote:

> Log:
>  Revert r327781,  r328093, r328056:
>  ufs|ext2fs: Revert uses of mallocarray(9).
>
>  These aren't really useful: drop them.
>  Variable unsigning will be brought again later.

Variable "unsigning" (that is, adding unsign extension bugs) is even more
negatively useful than mallocarray(), so should not be brought back.

Unsigning variables used _only_ for array sizes and element counts doesn't
cause any new problems (and fixes warnings about converting from signed to
unsigned when calling malloc*()), but it is a lot of work to check that
they aren't used for other things where their signedness matters (perhaps
differences or loops that count down to -1 instead of 0).

Unsigned variables also break checking for overflow in expressions by
compiling with -ftrapv.

Bruce


More information about the svn-src-all mailing list