Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Mar 2016 19:27:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 207854] usr/src/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c:1437: bad shift ?
Message-ID:  <bug-207854-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207854

            Bug ID: 207854
           Summary: usr/src/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.
                    c:1437: bad shift ?
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: dcb314@hotmail.com

[usr/src/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c:1437]: (error)
Shifting 32-bit value by 63 bits is undefined behaviour

Source code is

       for (tmpN=3D7 ; tmpN<64; tmpN++ )
        {
            tmp =3D ABS((int)(slope - tmpA/(1<<tmpN)));

Maybe better code

       for (tmpN=3D7 ; tmpN<64; tmpN++ )
        {
            tmp =3D ABS((int)(slope - tmpA / (1UL << tmpN)));

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207854-8>