https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78620

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2016-12-01
     Ever confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Since C++11 zero-initialization requires that padding is initialized to zero
bits;

        fprintf(stderr, "no initialization\n");
        print(&tt1);

That's default-initialization (which for this type performs no initialization).

        struct tm tt2 = tm();
        fprintf(stderr, "default initialization\n");
        print(&tt2);

That's value-initialization (which for this type performs zero-initialization).

                new (buf) tm();
                fprintf(stderr, "placement new with default constructor
initialization\n");

That's also value-initialization (so should also perform zero-initialization).

However, GCC 4.8 has been unsupported for a while now, please try a supported
version (5 or 6).

Reply via email to