#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 10/06/11 at 00:07:10 by Ralf Corsepius

Cc: Sebastian Huber added

comment:2 Changed on 10/06/11 at 04:29:03 by Chris Johns

Cc: Chris Johns added

comment:3 Changed on 10/06/11 at 18:00:13 by dufault

Cc: dufault added

comment:4 Changed on 10/07/11 at 08:12:15 by Ralf Corsepius

Resolution: fixed
Status: newclosed

comment:5 Changed on 10/07/11 at 09:30:55 by dufault

Resolution: fixed
Status: closedreopened

comment:6 Changed on 10/10/11 at 07:22:40 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 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.