Merge branch 'backport-4066-msys2-ci-fix-glib-2-80' into 'glib-2-80'

Backport !4066 “Fix several GCC 14 warnings to please msys2-mingw32 CI” to glib-2-80

See merge request GNOME/glib!4072
This commit is contained in:
Emmanuele Bassi 2024-05-15 11:20:40 +00:00
commit 71a143f32f
3 changed files with 6 additions and 5 deletions

View File

@ -379,7 +379,7 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
{
/* src1 or src2 is zero. */
dest->nlimbs = 0;
dest->limbs = (mp_limb_t *) malloc (1);
dest->limbs = (mp_limb_t *) malloc (sizeof (mp_limb_t));
}
else
{

View File

@ -136,6 +136,7 @@ test_types (void)
* to make sure that we dont warn when built against older third party code. */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
g_atomic_pointer_set (&vp_str_vol, NULL);
g_atomic_pointer_set (&vp_str, str);
res = g_atomic_pointer_compare_and_exchange (&vp_str_vol, NULL, str);

View File

@ -71,11 +71,11 @@ MEM_OVERFLOW_TEST (new0_b, p = g_new0 (X, b))
MEM_OVERFLOW_TEST (renew_a, p = g_malloc (1); p = g_renew (X, p, a))
MEM_OVERFLOW_TEST (renew_b, p = g_malloc (1); p = g_renew (X, p, b))
MEM_OVERFLOW_TEST_FULL (aligned_alloc_a, p = g_aligned_alloc (sizeof(X), a, 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc_b, p = g_aligned_alloc (sizeof(X), b, 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc_a, p = g_aligned_alloc (a, sizeof(X), 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc_b, p = g_aligned_alloc (b, sizeof(X), 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc0_a, p = g_aligned_alloc0 (sizeof(X), a, 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc0_b, p = g_aligned_alloc0 (sizeof(X), b, 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc0_a, p = g_aligned_alloc0 (a, sizeof(X), 16), g_aligned_free)
MEM_OVERFLOW_TEST_FULL (aligned_alloc0_b, p = g_aligned_alloc0 (b, sizeof(X), 16), g_aligned_free)
static void
mem_overflow_malloc_0 (void)