[PATCH v2] rtems/printer.h Fix build warnings -Wclass-memaccess
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Aug 12 14:43:24 UTC 2020
On 11/08/2020 14:30, Joel Sherrill wrote:
>
>
> On Tue, Aug 11, 2020 at 3:41 AM Aschref Ben-Thabet
> <aschref.ben-thabet at embedded-brains.de
> <mailto:aschref.ben-thabet at embedded-brains.de>> wrote:
>
> From: Aschref Ben Thabet <aschref.ben-thabet at embedded-brains.de
> <mailto:aschref.ben-thabet at embedded-brains.de>>
>
> ---
> 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 dbd887221e..310937cc2f 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 ) );
>
>
> I understand the patch but does this mean all header files have to be
> C++XX
> clean? Where XX is what version of C++.
>
> I'm more concerned by the implications of the patch than the patch itself.
I think the goal should be that RTEMS API header files work well with
C++11, C++17, C++20, and so on.
More information about the devel
mailing list