This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Wclass-memaccess warning should be in -Wextra, not -Wall
- From: Soul Studios <matt at soulstudios dot co dot nz>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 6 Jul 2018 11:14:41 +1200
- Subject: -Wclass-memaccess warning should be in -Wextra, not -Wall
Simply because a struct has a constructor does not mean it isn't a
viable target/source for use with memcpy/memmove/memset.
Having benchmarked the alternatives memcpy/memmove/memset definitely
makes a difference in various scenarios.
The bypass of littering code with needless reinterpret_cast<void *>'s is
fugly.
Members which are invariants should of course be noted, but anyone using
memset/cpy/move probably knows this.
Please discuss this annoyance. I would prefer this be moved into Extra,
as this is less commonly used.