Snapshot gcc-8-20180810 is now available on
ftp://gcc.gnu.org/pub/gcc/snapshots/8-20180810/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
This snapshot has been generated from the GCC 8 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-8
On Fri, Aug 10, 2018 at 6:08 PM, Sam McCall wrote:
> json::Value in JSON.h is a discriminated union.
> The storage is a char array of appropriate type and alignment. The storage
> holds one object at a time, it's initialized (and for nontrivial types,
> destroyed) at the right times to ensure this
json::Value in JSON.h is a discriminated union.
The storage is a char array of appropriate type and alignment. The storage
holds one object at a time, it's initialized (and for nontrivial types,
destroyed) at the right times to ensure this. The cast is only to the type
of object that's already ther
On 08/10/2018 05:30 AM, Liu Hao wrote:
> Only an lvalue of a pointer to (possibly CV-qualified) `void` or a
> pointer to a character type (in C) / any of `char`, `unsigned char` or
> `std::byte` (in C++) can alias objects.
Yes.
> That is to say, in order to eliminate the aliasing problem an
>
在 2018-08-10 18:53, Kim Gräsman 写道:
I'm worried that this might only serve to trick the compiler.
It shouldn't. If it was merely a trick then `std::aligned_storage` would
be completely unusable.
Explicitly using `-fno-strict-aliasing` for GCC < 6 would seem more
direct to me -- as Jonathan
Hi LH_Mouse,
Thanks!
On Fri, Aug 10, 2018 at 6:30 AM, Liu Hao wrote:
>
> When I used to do such type punning in C, I got similar warnings. Then I
> looked for some solutions... I can't recall the principle now and I fail to
> find it in the C or C++ standard. Despite that, the solution is simple