#1472 closed defect (fixed)

malloc_boundary.c:89: warning: left shift count >= width of type

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

Description

Building RTEMS-HEAD for 16bit targets raises this warning:

./../../../../../c/src/../../cpukit/libcsupport/src/malloc_boundary.c:89: warning: left shift count >= width of type

The piece of code in question is the "if ..." line from below:
...

fp = (int *)&size - 2;
for (i = 0 ; i < CALLCHAINSIZE ; i++) {

mp->callChain[i] = fp[1];
nfp = (int *)(fp[0]);

if((nfp <= fp)
(nfp > (int *)((intptr_t)1 << 24)))

break;

fp = nfp;

}

...

I don't understand this piece of code and therefore am unable to fix this warning.

Actually, I think, much of the code in "malloc_boundary.c" is "dirty" and "hackerish" (based on invalid implicit, likely target-specific, assumptions).

Attachments (1)

pr1472.diff (13.4 KB) - added by Joel Sherrill on Jun 30, 2010 at 2:36:06 PM.
Remove Malloc Boundary Code

Download all attachments as: .zip

Change History (5)

comment:1 Changed on Jun 25, 2010 at 6:16:35 AM by Sebastian Huber

Cc: Sebastian Huber added

comment:2 Changed on Jun 25, 2010 at 6:22:35 AM by Chris Johns

Cc: Chris Johns added

Changed on Jun 30, 2010 at 2:36:06 PM by Joel Sherrill

Attachment: pr1472.diff added

Remove Malloc Boundary Code

comment:3 Changed on Aug 6, 2010 at 9:35:45 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

comment:4 Changed on Aug 6, 2010 at 10:03:36 PM by Joel Sherrill

Closing.

Note: See TracTickets for help on using tickets.