Changeset 0d51b6d8 in rtems


Ignore:
Timestamp:
Jun 28, 2018, 12:39:37 PM (10 months ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
26c3f9f
Parents:
408fad3
git-author:
Daniel Hellstrom <daniel@…> (06/28/18 12:39:37)
git-committer:
Daniel Hellstrom <daniel@…> (08/24/18 13:51:39)
Message:

capture: prevent unaligned access when reading time

LLVM warns about this:

cpukit/libmisc/capture/capture.c:405:30: warning:

taking address of packed member 'time' of class or structure
'rtems_capture_record' may result in an unaligned pointer value
[-Waddress-of-packed-member]

rtems_capture_get_time (&in.time);

And on sparc it generates an unaligned trap which makes smpcapture01
and smpcapture02 test to fail on sparc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/capture/capture.c

    r408fad3 r0d51b6d8  
    388388  {
    389389    rtems_capture_record in;
     390    rtems_capture_time time;
    390391
    391392    ++cpu->count;
     
    403404                  (rtems_capture_task_curr_priority (tcb) << 8));
    404405
    405     rtems_capture_get_time (&in.time);
     406    rtems_capture_get_time (&time);
     407    in.time = time; /* need this since in is a packed struct */
    406408
    407409    ptr = rtems_capture_record_append(ptr, &in, sizeof(in));
Note: See TracChangeset for help on using the changeset viewer.