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: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: Andy Webber <andy at aligature dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 05 Sep 2014 08:16:18 +0100
- Subject: Re: is portable aliasing possible in C++?
- Authentication-results: sourceware.org; auth=none
- References: <A76FB9DDEDFA994BAF6B77704A4AF465BC2464 at xchmbbal502 dot ds dot susq dot com> <CADa0DUiuqwF2rbvBcUQOFMN7iVMtedryYLO3i1gCskSRdcOvtg at mail dot gmail dot com> <5408988E dot 2060301 at redhat dot com> <CAH6eHdQxUNL0EbKJpT+qWfq_0py4eGQjqSKG99hjcWn3CBgOTg at mail dot gmail dot com>
On 05/09/14 00:11, Jonathan Wakely wrote:
> FWIW I prefer the memcpy approach, it usually generates the same code
> as type punning via a union,
You wouldn't say that if you'd tried the test code provided by the OP.
Andrew.