#1928 closed defect (fixed)

mpc5674fevb: powerpc/mpc55xx/misc/flash_support.c:183:9: warning: case label value exceeds maximum value for type

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

Description

gcc issues the warning above when building the mpc5674fevb:

...
powerpc-rtems4.11-gcc --pipe -B../../../../.././lib/ -B../../../../.././mpc5674fevb/lib/ -specs bsp_specs -qrtems -DPACKAGE_NAME=\"rtems-c-src-lib-libcpu-powerpc\" -DPACKAGE_TARNAME=\"rtems-c-src-lib-libcpu-powerpc\" -DPACKA
mv -f $depbase.Tpo $depbase.Po
../../../../../../../c/src/lib/libcpu/powerpc/mpc55xx/misc/flash_support.c: In function 'mpc55xx_flash_size':
../../../../../../../c/src/lib/libcpu/powerpc/mpc55xx/misc/flash_support.c:183:9: warning: case label value exceeds maximum value for type [enabled by default]
...

The code in question reads:
...

switch(FLASH.MCR.B.SIZE) {

...

case 11:
hblocks = 20;
break;

...

with FLASH.MCR.B.SIZE being a bitfield of size 3 (c.f. struct FLASH_tag in
c/src/lib/libcpu/powerpc/mpc55xx/include/fsl-mpc567x.h),

i.e. a decimal 11 doesn't fit into SIZE.

Once again, the bug is apparent, but I am lacking knowledge on the details to be able to fix it.

My gut feeling is, the spare bit following SIZE in struct FLASH_tag
...

uint32_t SIZE:3;
uint32_t:1;

...
actually should be added to SIZE (but I don't know if this would be correct).

Change History (7)

comment:1 Changed on Oct 6, 2011 at 12:07:10 AM by Ralf Corsepius

Cc: Sebastian Huber added

comment:2 Changed on Oct 6, 2011 at 4:29:03 AM by Chris Johns

Cc: Chris Johns added

comment:3 Changed on Oct 6, 2011 at 6:00:13 PM by dufault

Cc: dufault added

comment:4 Changed on Oct 7, 2011 at 8:12:15 AM by Ralf Corsepius

Resolution: fixed
Status: newclosed

comment:5 Changed on Oct 7, 2011 at 9:30:55 AM by dufault

Resolution: fixed
Status: closedreopened

comment:6 Changed on Oct 10, 2011 at 7:22:40 AM by Sebastian Huber

Resolution: fixed
Status: reopenedclosed

This header file is provided by Freescale and should be not modified. I disabled the flash support for MPC56XX. We need the flash support for MPC56XX and currently work on that.

comment:7 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.