https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #12 from ma.jiang at zte dot com.cn ---
(In reply to Jim Wilson from comment #11)
Hi Jim,
Thank you for your patient explanations.
>
> If you have code with a lot of pointer casts, you should probably be
> compiling with -fno-stric
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #11 from Jim Wilson ---
This language has been in the standard since ANSI C 89/ISO C 90.
>extern char buf[32];
>int *a = (int *)&(buf[16]);
>int result = *a; //is this ok? or we have to use memcpy(&result, &buf[16],
>>sizeof(int))?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #10 from Markus Trippelsdorf ---
When in doubt you could use -fno-strict-aliasing.
And sorry, but this is not the right place to discuss the aliasing rules of the
standard.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #9 from ma.jiang at zte dot com.cn ---
(In reply to Jim Wilson from comment #8)
> Looking at the 2011 ISO C standard, section 6.5 Expressions, paragraph 7,
> says "An object shall have its stored value accessed only by an lvalue
> expr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
Jim Wilson changed:
What|Removed |Added
CC||wilson at gcc dot gnu.org
--- Comment #8 fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #7 from ma.jiang at zte dot com.cn ---
(In reply to Markus Trippelsdorf from comment #5)
Hi Markus,
> These optimizations are not dangerous if you use standard conforming code.
I think these optimizations are dangerous because t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
Eric Gallager changed:
What|Removed |Added
CC||egall at gwmail dot gwu.edu
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #5 from Markus Trippelsdorf ---
(In reply to ma.jiang from comment #4)
> (In reply to Markus Trippelsdorf from comment #3)
> > Please no.
> > There are many other cases where optimizations could introduce issues that
> > you will not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #4 from ma.jiang at zte dot com.cn ---
(In reply to Markus Trippelsdorf from comment #3)
> Please no.
> There are many other cases where optimizations could introduce issues that
> you will not notice when you compile without warnings
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
Markus Trippelsdorf changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #2 from Andrew Pinski ---
-Wstrict-aliasing is already included in -Wall which most people turn on. -W
(-Wextra) is the other most turn on too. Strict-overflow cause issues too if
not careful or not understand the language you are wri
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78772
--- Comment #1 from ma.jiang at zte dot com.cn ---
Created attachment 40308
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40308&action=edit
proposed patch
12 matches
Mail list logo