* Default initialization of poly-ints
@ 2023-01-03 11:16 Florian Weimer
2023-01-04 20:30 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2023-01-03 11:16 UTC (permalink / raw)
To: gcc
It seems that the default constructor of the non-POD poly-ints does
nothing. Is this intentional? I expected zero initialization, to match
regular ints.
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Default initialization of poly-ints
2023-01-03 11:16 Default initialization of poly-ints Florian Weimer
@ 2023-01-04 20:30 ` Jeff Law
2023-01-12 16:49 ` Richard Sandiford
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2023-01-04 20:30 UTC (permalink / raw)
To: Florian Weimer, gcc
On 1/3/23 04:16, Florian Weimer via Gcc wrote:
> It seems that the default constructor of the non-POD poly-ints does
> nothing. Is this intentional? I expected zero initialization, to match
> regular ints.
I think it was intentional. Richard Sandiford would know for sure. But
Martin Sebor might know as well since I think they discussed it at
length a little while back.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Default initialization of poly-ints
2023-01-04 20:30 ` Jeff Law
@ 2023-01-12 16:49 ` Richard Sandiford
0 siblings, 0 replies; 3+ messages in thread
From: Richard Sandiford @ 2023-01-12 16:49 UTC (permalink / raw)
To: Jeff Law via Gcc; +Cc: Florian Weimer, Jeff Law
Jeff Law via Gcc <gcc@gcc.gnu.org> writes:
> On 1/3/23 04:16, Florian Weimer via Gcc wrote:
>> It seems that the default constructor of the non-POD poly-ints does
>> nothing. Is this intentional? I expected zero initialization, to match
>> regular ints.
> I think it was intentional. Richard Sandiford would know for sure. But
> Martin Sebor might know as well since I think they discussed it at
> length a little while back.
Yeah, it was intentional, to try to get -Wunitialized warnings.
But it predates C++11 being required, so = default would probably
be a better choice now.
Thanks,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-12 16:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 11:16 Default initialization of poly-ints Florian Weimer
2023-01-04 20:30 ` Jeff Law
2023-01-12 16:49 ` Richard Sandiford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).