Page MenuHomeFreeBSD

1 << 31 redux
AbandonedPublic

Authored by eadler on Jan 11 2018, 11:59 AM.
Tags
None
Referenced Files
F83648626: D13858.diff
Mon, May 13, 2:16 AM
Unknown Object (File)
Thu, May 9, 11:20 PM
Unknown Object (File)
Sat, May 4, 4:47 AM
Unknown Object (File)
Fri, May 3, 11:08 AM
Unknown Object (File)
Tue, Apr 30, 2:24 AM
Unknown Object (File)
Mon, Apr 29, 8:22 AM
Unknown Object (File)
Sat, Apr 27, 5:20 PM
Unknown Object (File)
Sat, Apr 27, 1:41 AM

Details

Reviewers
kib
sbruno
manu
Summary

There are a few cases in FreeBSD where the expression (1 << 31) is used.

However this produces undefined behavior as '1' is of type int. (see
6.4.4p5: The type of an unmarked integer constant is the first of the
following list in which its value can be represented: int, long int,
long long int). The shift of 31 is illegal (see 6.5.7p4) if the size
of an int is 32.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14327
Build 14485: arc lint + arc unit

Event Timeline

kib requested changes to this revision.Jan 11 2018, 12:19 PM
kib added a subscriber: kib.
kib added inline comments.
sys/ufs/ffs/ffs_vfsops.c
1177 ↗(On Diff #37788)

This is not needed.

sys/vm/vm_mmap.c
103 ↗(On Diff #37788)

This is not needed.

This revision now requires changes to proceed.Jan 11 2018, 12:19 PM

remove missed instances of casted 1s

erj added a subscriber: erj.

The changes to the Intel ethernet drivers look fine to me.

Changes to dev/mlx4 and dev/mlx5 look fine, but commit them as separate patch.

sys/x86/include/specialreg.h
209

This one is fine.

eadler abandoned this revision.