[Bug 1927] New: mpc83xx/network/tsec.c large integer implicitly truncated to unsigned type

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Wed Oct 5 17:11:20 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1927

           Summary: mpc83xx/network/tsec.c large integer implicitly
                    truncated to unsigned type
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: bsps
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: ralf.corsepius at rtems.org


Building mpc83xx-based BSPs raises this warning:
...
c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c:334:3: warning: large integer
implicitly truncated to unsigned type [-Woverflow]
...

The line of code in question looks like this:
...
  static const uint8_t divider [] = { 64, 64, 96, 128, 160, 224, 320, 448 };
...

This is apparently wrong, because 320 and 448 are greater than the maximum
value of uint8_t (255).

Unfortunately, I am not sufficiently familiar with this code to be able to fix
this issue. My guess is, divider should be an array of uint32_t's.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list