Here is the warning after my patch:
1.cpp: In function 'int foo(int, int, int)':
1.cpp:29:70: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
return hash2(static_cast(change1), len / 2);
Hi Richard,
> Generally I don't think we want to expand the use of the IMHO broken
> strict_aliasing_warning code.
If you have read my test code, you must understand it is the
programmer who responsible for this undefined behavior, instead of
the compiler. Like PR 60546 concluded.
On Tue, Aug 19, 2014 at 7:20 AM, lin zuojian wrote:
> Hi,
> Here patch v2. Move the function as Andrew instructed.
>
> * tree-inline.c (setup_one_parameter): Add strict aliasing check.
> * c-family/c-common.c (strict_aliasing_warning): Move to alias.c.
> * c-family/c-common.h (stri
Hi,
Here patch v2. Move the function as Andrew instructed.
* tree-inline.c (setup_one_parameter): Add strict aliasing check.
* c-family/c-common.c (strict_aliasing_warning): Move to alias.c.
* c-family/c-common.h (strict_aliasing_warning): Move to tree.h.
* alias.c (strict_alia