#1927 closed defect (fixed)

mpc83xx/network/tsec.c large integer implicitly truncated to unsigned type

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: bsps Version: 4.11
Severity: normal Keywords:
Cc: thomas.doerfler@…, sebastian.huber@… Blocked By:
Blocking:

Description

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.

Change History (4)

comment:1 Changed on Oct 5, 2011 at 4:12:02 PM by Ralf Corsepius

Cc: Sebastian Huber added

comment:2 Changed on Nov 9, 2011 at 7:54:07 PM by Joel Sherrill

Cc: thomas.doerfler added

comment:3 Changed on Nov 10, 2011 at 7:45:11 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

Fixed on CVS head.

comment:4 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.