[RTEMS Project] #4013: Using the size of an object to deduce the alignment is broken on some architectures

RTEMS trac trac at rtems.org
Tue Jun 23 16:32:00 UTC 2020


#4013: Using the size of an object to deduce the alignment is broken on some
architectures
------------------------------+-----------------------------
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  defect           |     Status:  assigned
  Priority:  normal           |  Milestone:  5.2
 Component:  score            |    Version:  5
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------------
 For example, code like this
 {{{
 RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_area_aligned(
   const void *starting_address
 )
 {
   return (((uintptr_t) starting_address) % CPU_SIZEOF_POINTER) == 0;
 }
 }}}
 is broken on architectures with relaxed alignment requirements, e.g. on
 m68k is alignof(void *) == 2 and sizeof(void *) == 4. This may cause
 sporadic failures of psxconfig01.

--
Ticket URL: <http://devel.rtems.org/ticket/4013>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list