This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] document -Wclass-memaccess suppression by casting (PR 81327)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 14 Jan 2018 11:31:41 +0100
- Subject: Re: [PATCH] document -Wclass-memaccess suppression by casting (PR 81327)
- Authentication-results: sourceware.org; auth=none
- References: <e4a2046f-e629-9bb6-33ca-af6b73979a6d@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Jan 13, 2018 at 04:14:38PM -0700, Martin Sebor wrote:
> -The @option{-Wclass-memaccess} option is enabled by @option{-Wall}.
> +The @option{-Wclass-memaccess} option is enabled by @option{-Wall}. Casting
Perhaps "Explicitly casting" instead? The implicit cast doesn't suppress it
and occurs whenever there isn't an explicit cast.
> +the pointer to the class object to @code{void *} or to a type that can be
> +safely accessed by the raw memory function suppresses the warning.
>
> @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
> @opindex Wnon-virtual-dtor
Jakub