[Bug 1928] New: mpc5674fevb: powerpc/mpc55xx/misc/flash_support.c:183:9: warning: case label value exceeds maximum value for type

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Oct 6 01:06:54 UTC 2011


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

           Summary: mpc5674fevb:
                    powerpc/mpc55xx/misc/flash_support.c:183:9: warning:
                    case label value exceeds maximum value for 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


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).

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