[Bug 1531] ALIGN() should use uintptr_t

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu May 27 07:26:58 CDT 2010


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





--- Comment #1 from Ralf Corsepius <ralf.corsepius at rtems.org>  2010-05-27 07:26:57 ---
My opinion on it:

Though using uintptr_t would be technically correct, 
the fact ALIGN is in machine/params.h is questionable at best.

Check the BSD's orginal sources:

# grep -R -E 'define[\s]* (ALIGN|_ALIGN)[ ]*\(' /usr/*bsd*/sys-root/usr/include 
/usr/amd64-pc-netbsdelf5.0.2/sys-root/usr/include/machine/param.h:#define
ALIGN(p)        (((u_long)(p) + ALIGNBYTES) &~ALIGNBYTES)
/usr/amd64-pc-netbsdelf5.0.2/sys-root/usr/include/amd64/param.h:#define
ALIGN(p)        (((u_long)(p) + ALIGNBYTES) &~ALIGNBYTES)
/usr/amd64-pc-netbsdelf5.0.2/sys-root/usr/include/i386/param.h:#define ALIGN(p)
       (((u_int)(u_long)(p) + ALIGNBYTES) &~ \
/usr/i386-openbsd4.7/sys-root/usr/include/machine/param.h:#define ALIGN(p)   
(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
/usr/i386-openbsd4.7/sys-root/usr/include/i386/param.h:#define ALIGN(p)   
(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
/usr/i386-pc-netbsdelf5.0.2/sys-root/usr/include/machine/param.h:#define
ALIGN(p)        (((u_int)(u_long)(p) + ALIGNBYTES) &~ \
/usr/i386-pc-netbsdelf5.0.2/sys-root/usr/include/i386/param.h:#define ALIGN(p) 
      (((u_int)(u_long)(p) + ALIGNBYTES) &~ \
/usr/i586-pc-freebsd6.4/sys-root/usr/include/machine/param.h:#define _ALIGN(p) 
  (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
/usr/i586-pc-freebsd6.4/sys-root/usr/include/machine/param.h:#define ALIGN(p)  
 _ALIGN(p)
/usr/i586-pc-freebsd7.3/sys-root/usr/include/machine/param.h:#define _ALIGN(p) 
  (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
/usr/i586-pc-freebsd7.3/sys-root/usr/include/machine/param.h:#define ALIGN(p)  
 _ALIGN(p)
/usr/i586-pc-freebsd8.0/sys-root/usr/include/machine/param.h:#define _ALIGN(p) 
  (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
/usr/i586-pc-freebsd8.0/sys-root/usr/include/machine/param.h:#define ALIGN(p)  
 _ALIGN(p)

Note: ALIGN is not present in amd64-*freebsd*

IMO, we should get rid of it in machine/params.h and add it as a private header
in rtems.

-- 
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 rtems-bugs mailing list