[RTEMS Project] #2923: Questionable Code in resource_snapshot.c

RTEMS trac trac at rtems.org
Mon Mar 13 15:09:00 UTC 2017


#2923: Questionable Code in resource_snapshot.c
---------------------------+------------------------------
 Reporter:  Joel Sherrill  |       Owner:  Sebastian Huber
     Type:  defect         |      Status:  assigned
 Priority:  normal         |   Milestone:  4.12
Component:  cpukit         |     Version:  4.12
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------------------

Comment (by Gedare):

 Very ugly. The hack might be a bit more clear if we use

 {{{

 typedef struct {
   Heap_Information_block workspace_info;
   Heap_Information_block heap_info;
   uint32_t active_posix_key_value_pairs;
   union {
     uint32_t anonymous[ 1 + ( sizeof(rtems_resource_rtems_api) +
 sizeof(rtems_resource_posix_api) ) / sizeof(uint32_t) ];
     struct {
       uint32_t active_posix_keys;
       rtems_resource_rtems_api rtems_api;
       rtems_resource_posix_api posix_api;
     }
   }
   int open_files;
 } rtems_resource_snapshot;
 }}}

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


More information about the bugs mailing list