[rtems commit] rtems/printer.h Fix build warnings -Wclass-memaccess

Sebastian Huber sebh at rtems.org
Mon Aug 17 09:59:30 UTC 2020


Module:    rtems
Branch:    master
Commit:    5869c64793e5991625f58b349ce3696a9ebdc229
Changeset: http://git.rtems.org/rtems/commit/?id=5869c64793e5991625f58b349ce3696a9ebdc229

Author:    Aschref Ben Thabet <aschref.ben-thabet at embedded-brains.de>
Date:      Tue Aug 11 10:41:26 2020 +0200

rtems/printer.h Fix build warnings -Wclass-memaccess

---

 cpukit/include/rtems/printer.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/printer.h b/cpukit/include/rtems/printer.h
index dbd8872..310937c 100644
--- a/cpukit/include/rtems/printer.h
+++ b/cpukit/include/rtems/printer.h
@@ -130,7 +130,11 @@ static inline void rtems_printer_task_initialize(
   rtems_printer_task_context *context
 )
 {
-  memset( context, 0, sizeof( *context ) );
+  /*
+   * Some C++ compiler think that the structure is complex enough to need a
+   * proper constructor. Cast to void * to silence a warning.
+   */
+  memset( (void *) context, 0, sizeof( *context ) );
 }
 
 static inline void rtems_printer_task_set_stack_size(



More information about the vc mailing list