[RTEMS Project] #1531: ALIGN() should use uintptr_t

RTEMS trac trac at rtems.org
Sat Nov 22 23:51:55 UTC 2014


#1531: ALIGN() should use uintptr_t
---------------------------+-----------------------------
 Reporter:  joel.sherrill  |       Owner:  ralf.corsepius
     Type:  defect         |      Status:  closed
 Priority:  normal         |   Milestone:  4.11
Component:  Newlib         |     Version:  unknown
 Severity:  normal         |  Resolution:  fixed
 Keywords:                 |
---------------------------+-----------------------------
Changes (by joel.sherrill):

 * milestone:  2 => 4.11


Old description:

> I got this failure on m32c/m32csim.
>
> ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/fts.c: In
> function 'fts_alloc':
> ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/fts.c:1058:
> error: cast to pointer from integer of different size
>
> I tracked it down to this definition in machine/param.h
>
> #define ALIGN(p)        (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
>
> The unsigned should be a uintptr_t.

New description:

 I got this failure on m32c/m32csim.

 ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/fts.c: In
 function 'fts_alloc':
 ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/fts.c:1058:
 error: cast to pointer from integer of different size

 I tracked it down to this definition in machine/param.h

 #define ALIGN(p)        (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)

 The unsigned should be a uintptr_t.

--

Comment:

 This is still the definition of ALIGN in RTEMS' sys/param.h in newlib. The
 line of code hasn't changed since 2002. But the warning is no longer
 present. I had a build from overnight and double checking. Based on when
 this was filed, it would most likely be a 4.11 milestone.

--
Ticket URL: <http://devel.rtems.org/ticket/1531#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list