Giuseppe D'Angelo
b694ada294
Do not memset(0) POD types
...
"POD" is the wrong type trait to determine if something can be safely
zero-filled in order to achieve zero initialization. Consider a type
like
struct POD { int POD::*ptr; };
This is a POD; its value initialization needs to value initialize the
member, and since it's a pointer, that's zero initialization, and that's
setting the pointer to null.
On Itanium, a null pointer to data member is not zero filled; it actually
has the value -1u.
Hence, zero-filling via memset(0) a POD object like the one above is
erroneous. Unfortunately there is no type trait in C++ that we can use to
know if a given datatype can be value initialized by zero-filling -- we
can check for trivial constructability, but that's a necessary
condition, not a sufficient one (POD above is also trivially
constructible).
The test is disabled on MSVC because of a compiler bug.
Fixes #238
2023-02-02 11:29:53 +01:00
..
2015-09-07 19:16:46 +02:00
2021-10-16 15:57:47 +02:00
2021-12-29 23:44:18 +01:00
2020-07-12 11:06:01 +02:00
2021-12-31 01:14:06 +01:00
2022-01-04 00:41:34 +01:00
2022-01-12 01:40:42 +01:00
2017-10-19 21:53:37 +02:00
2021-10-16 15:57:47 +02:00
2022-10-01 23:39:28 +02:00
2021-12-28 15:17:15 +01:00
2020-08-09 23:23:13 +02:00
2023-02-01 23:00:23 +01:00
2021-12-27 01:01:10 +01:00
2022-10-01 23:39:28 +02:00
2023-02-01 23:00:23 +01:00
2021-12-28 15:17:15 +01:00
2021-12-28 15:17:15 +01:00
2022-08-24 14:48:59 +02:00
2021-12-28 15:17:15 +01:00
2018-09-25 09:07:09 +02:00
2020-08-10 00:16:58 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:07:09 +02:00
2018-09-25 09:08:24 +02:00
2021-12-28 15:17:15 +01:00
2020-08-10 00:16:58 +02:00
2022-06-25 20:29:16 +02:00
2020-08-10 00:16:58 +02:00
2022-06-25 20:29:16 +02:00
2022-01-04 00:36:36 +01:00
2023-02-01 23:00:23 +01:00
2014-11-26 07:08:06 +01:00
2020-08-10 00:16:58 +02:00
2021-10-16 15:57:47 +02:00
2015-01-28 22:11:00 +01:00
2017-11-07 00:51:46 +01:00
2020-08-09 23:21:46 +02:00
2021-10-16 15:57:47 +02:00
2020-08-09 23:21:46 +02:00
2021-10-20 00:18:05 +02:00
2021-12-27 01:01:10 +01:00
2023-02-01 23:00:23 +01:00
2018-09-23 15:54:39 -04:00
2022-08-24 14:32:46 +02:00
2022-01-04 00:41:34 +01:00
2019-12-22 20:03:57 -05:00
2020-07-12 11:06:01 +02:00
2017-11-07 00:51:46 +01:00
2020-08-10 00:16:58 +02:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2015-09-07 19:16:46 +02:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2017-11-07 00:51:46 +01:00
2020-08-31 13:37:11 +02:00
2016-05-13 22:17:23 +02:00
2015-01-02 19:34:21 +01:00
2020-05-25 00:35:07 +02:00
2017-11-07 00:51:46 +01:00
2019-05-05 02:06:46 +02:00
2020-07-12 11:06:01 +02:00
2020-07-12 11:06:01 +02:00
2022-01-04 00:41:34 +01:00
2021-10-20 00:18:05 +02:00
2020-08-09 23:21:46 +02:00
2019-06-08 13:01:24 +02:00
2019-06-01 22:36:54 +09:00
2020-08-09 23:21:46 +02:00
2023-02-01 23:00:23 +01:00
2023-02-01 23:00:23 +01:00
2020-10-22 01:12:59 +02:00
2022-12-12 00:50:27 +01:00
2017-02-21 14:27:18 +01:00
2015-09-07 19:16:46 +02:00
2020-10-22 01:12:59 +02:00
2022-09-20 00:22:19 +02:00
2019-12-19 05:29:46 +01:00
2022-01-04 16:43:20 +01:00
2015-09-07 19:16:46 +02:00
2020-08-31 22:21:41 +02:00
2020-10-22 01:12:59 +02:00
2023-02-02 11:29:53 +01:00
2023-02-01 23:00:23 +01:00