Notice: We have migrated to GitLab launching 2024-05-01 see here:

#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:


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 10/05/11 at 16:12:02 by Ralf Corsepius

Cc: Sebastian Huber added

comment:2 Changed on 11/09/11 at 19:54:07 by Joel Sherrill

Cc: thomas.doerfler added

comment:3 Changed on 11/10/11 at 07:45:11 by Sebastian Huber

Resolution: fixed
Status: newclosed

Fixed on CVS head.

comment:4 Changed on 11/24/14 at 18:58:28 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.