This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: is portable aliasing possible in C++?
- From: Andrew Haley <aph at redhat dot com>
- To: Hei Chan <structurechart at yahoo dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 15 Sep 2014 12:32:35 +0100
- Subject: Re: is portable aliasing possible in C++?
- Authentication-results: sourceware.org; auth=none
- References: <1410390231 dot 39617 dot YahooMailNeo at web140202 dot mail dot bf1 dot yahoo dot com> <54115917 dot 1040602 at redhat dot com> <1410477938 dot 56522 dot YahooMailNeo at web140205 dot mail dot bf1 dot yahoo dot com> <5412AF85 dot 1080200 at redhat dot com> <1410562688 dot 66898 dot YahooMailNeo at web140201 dot mail dot bf1 dot yahoo dot com> <5413F0D4 dot 5010806 at redhat dot com> <1410748615 dot 48628 dot YahooMailNeo at web165004 dot mail dot bf1 dot yahoo dot com> <5416A4E1 dot 1010000 at redhat dot com> <1410779226 dot 12412 dot YahooMailNeo at web165006 dot mail dot bf1 dot yahoo dot com> <5416CBC1 dot 50900 at redhat dot com> <1410780568 dot 23391 dot YahooMailNeo at web165006 dot mail dot bf1 dot yahoo dot com>
On 09/15/2014 12:29 PM, Hei Chan wrote:
>
>
>
>
>
> On Monday, September 15, 2014 7:22 PM, Andrew Haley <aph@redhat.com> wrote:
>
>> Using memcpy(), the compiler will have to make a copy
>> because it sees that few lines, for example, down, the program tries
>> to manipulate the copy.
>
> So, don't manipulate the copy, then. Use it once, then throw it away.
>
> Sometimes, due to the endianness, I am forced to manipulate the copy...
I don't know what you mean. A small example would help.
Andrew.