Merge branch 'fix-mp_limb_t-size' into 'main'

Fix several GCC 14 warnings to please msys2-mingw32 CI

See merge request GNOME/glib!4066
This commit is contained in:
Emmanuele Bassi 2024-05-15 10:52:14 +00:00
commit 34626188aa
5 changed files with 23 additions and 6 deletions

View File

@ -492,6 +492,21 @@ cross-mingw64:
- _build/gthread/libgthread-2.0-0.dll - _build/gthread/libgthread-2.0-0.dll
- _build/gobject/libgobject-2.0-0.dll - _build/gobject/libgobject-2.0-0.dll
# A note about msys2: its a rolling release distribution, running Windows under
# Docker isnt really supported, and the win32-ps CI runner is shared. All that
# adds up to mean that we have to run CI against the latest msys2 packages, and
# that this occasionally causes build failures in GLib due to changes in msys2.
# In order to avoid that pre-empting other GLib development, the policy in such
# cases is to:
# 1. Immediately and without hesitation make the msys2-* CI jobs non-fatal
# (add `allow_failure: true` below).
# 2. File an issue about fixing the GLib msys2 build and re-enabling failure
# on the CI job
# 3. Set the milestone for that issue to be the next GLib release, so its done
# in a timely manner; and tag it as ~win32 so the GLib Windows maintainers
# are notified and can work on it.
# 4. Rebase any pending broken MRs on top of the commit which makes the CI job
# non-fatal, so that development on `main` is unblocked.
msys2-mingw32: msys2-mingw32:
extends: .only-default-and-merges extends: .only-default-and-merges
stage: build stage: build
@ -520,6 +535,7 @@ msys2-mingw32:
- _coverage/ - _coverage/
- _reference/ - _reference/
# See the note about msys2 CI job failure policy above.
msys2-clang64: msys2-clang64:
extends: .only-schedules-or-manual extends: .only-schedules-or-manual
stage: build stage: build

View File

@ -41,7 +41,7 @@ GLib is regularly built on at least the following systems:
- Fedora (34, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/fedora.Dockerfile) - Fedora (34, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/fedora.Dockerfile)
- Debian (Bullseye, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/debian-stable.Dockerfile) - Debian (Bullseye, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/debian-stable.Dockerfile)
- Windows (MinGW64) - Windows (MinGW64)
- Windows (msys2-mingw32) - Windows (msys2-mingw32 and msys2-clang64; msys2 is a rolling release distribution)
- Windows (Visual Studio 2017, and a static linking version) - Windows (Visual Studio 2017, and a static linking version)
- Android (NDK r23b, API 31, arm64, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/android-ndk.sh) - Android (NDK r23b, API 31, arm64, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/android-ndk.sh)
- FreeBSD (12 and 13) - FreeBSD (12 and 13)

View File

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

View File

@ -136,6 +136,7 @@ test_types (void)
* to make sure that we dont warn when built against older third party code. */ * to make sure that we dont warn when built against older third party code. */
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #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_vol, NULL);
g_atomic_pointer_set (&vp_str, str); g_atomic_pointer_set (&vp_str, str);
res = g_atomic_pointer_compare_and_exchange (&vp_str_vol, NULL, 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_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 (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_a, p = g_aligned_alloc (a, sizeof(X), 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_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_a, p = g_aligned_alloc0 (a, sizeof(X), 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_b, p = g_aligned_alloc0 (b, sizeof(X), 16), g_aligned_free)
static void static void
mem_overflow_malloc_0 (void) mem_overflow_malloc_0 (void)