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

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 30 15:22:12 UTC 2020


On 30/07/2020 15:59, Aschref Ben-Thabet wrote:

> From: Aschref Ben Thabet <aschref.ben-thabet at embedded-brains.de>
>
> ---
>   cpukit/include/rtems/printer.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpukit/include/rtems/printer.h b/cpukit/include/rtems/printer.h
> index dbd887221e..fc091ffda3 100644
> --- a/cpukit/include/rtems/printer.h
> +++ b/cpukit/include/rtems/printer.h
> @@ -130,7 +130,7 @@ static inline void rtems_printer_task_initialize(
>     rtems_printer_task_context *context
>   )
>   {
> -  memset( context, 0, sizeof( *context ) );

Could you please also add a comment which explains why this void * cast 
is there, e.g.

/* 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 ) );
>   }
>   
Spacing: (void *) context
>   static inline void rtems_printer_task_set_stack_size(


More information about the devel mailing list