Silence MSVC C4312 in list tests

This warning warns on widening casts from integer to pointer type,
because those casts can be problematic for porting to new pointer
sizes. The code in question didn't do any bad things here so an
intermediate cast to size_t was added to silence the warning
This commit is contained in:
Charles Barto 2021-12-15 17:21:20 -08:00
parent cdd53b9218
commit d60b4010c4

View File

@ -532,7 +532,9 @@ static void
test_double_free (void)
{
GList *list, *link;
GList intruder = { NULL, (gpointer)0xDEADBEEF, (gpointer)0xDEADBEEF };
// Casts to size_t first ensure compilers won't warn about pointer casts that change size
// MSVC's C4312 warning with /Wp64
GList intruder = { NULL, (gpointer)(size_t)0xDEADBEEF, (gpointer)(size_t)0xDEADBEEF };
if (g_test_subprocess ())
{