mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +01:00
Merge branch 'fix-warnings-clang-windows' into 'main'
Fix warnings with Clang on Windows and enable --Werror in CI See merge request GNOME/glib!3635
This commit is contained in:
commit
fa165204ae
@ -341,10 +341,6 @@ msys2-mingw32:
|
|||||||
CHERE_INVOKING: "yes"
|
CHERE_INVOKING: "yes"
|
||||||
CFLAGS: -coverage -ftest-coverage -fprofile-arcs
|
CFLAGS: -coverage -ftest-coverage -fprofile-arcs
|
||||||
PYTHONUTF8: "1"
|
PYTHONUTF8: "1"
|
||||||
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
|
|
||||||
# see https://github.com/msys2/MINGW-packages/issues/11864 and
|
|
||||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
|
|
||||||
MSYS: "winjitdebug"
|
|
||||||
script:
|
script:
|
||||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
||||||
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
||||||
@ -371,10 +367,6 @@ msys2-clang64:
|
|||||||
MSYSTEM: "CLANG64"
|
MSYSTEM: "CLANG64"
|
||||||
CHERE_INVOKING: "yes"
|
CHERE_INVOKING: "yes"
|
||||||
PYTHONUTF8: "1"
|
PYTHONUTF8: "1"
|
||||||
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
|
|
||||||
# see https://github.com/msys2/MINGW-packages/issues/11864 and
|
|
||||||
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
|
|
||||||
MSYS: "winjitdebug"
|
|
||||||
script:
|
script:
|
||||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
||||||
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
||||||
|
@ -32,14 +32,8 @@ PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
|||||||
DIR="$(pwd)"
|
DIR="$(pwd)"
|
||||||
export PATH CFLAGS
|
export PATH CFLAGS
|
||||||
|
|
||||||
if [[ "$MSYSTEM" == "CLANG64" ]]; then
|
# shellcheck disable=SC2086
|
||||||
# FIXME: fix the clang build warnings
|
meson setup ${MESON_COMMON_OPTIONS} --werror _build
|
||||||
# shellcheck disable=SC2086
|
|
||||||
meson setup ${MESON_COMMON_OPTIONS} _build
|
|
||||||
else
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
meson setup ${MESON_COMMON_OPTIONS} --werror _build
|
|
||||||
fi
|
|
||||||
|
|
||||||
meson compile -C _build
|
meson compile -C _build
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ typedef struct
|
|||||||
|
|
||||||
gint32 ref_count : 9;
|
gint32 ref_count : 9;
|
||||||
|
|
||||||
gint32 readable : 1;
|
guint32 readable : 1;
|
||||||
RegistryValue value;
|
RegistryValue value;
|
||||||
} RegistryCacheItem;
|
} RegistryCacheItem;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
#if G_CXX_STD_CHECK_VERSION (11)
|
#if G_CXX_STD_CHECK_VERSION (11)
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, nullptr);
|
||||||
#else
|
#else
|
||||||
g_test_init (&argc, &argv, static_cast<void *>(NULL));
|
g_test_init (&argc, &argv, static_cast<void *>(NULL));
|
||||||
#endif
|
#endif
|
||||||
|
@ -1661,7 +1661,7 @@ g_io_channel_new_file (const gchar *filename,
|
|||||||
mode_num |= MODE_PLUS;
|
mode_num |= MODE_PLUS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Fall through */
|
G_GNUC_FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
g_warning ("Invalid GIOFileMode %s.", mode);
|
g_warning ("Invalid GIOFileMode %s.", mode);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -426,27 +426,6 @@ static gboolean win32_keep_fatal_message = FALSE;
|
|||||||
* called with huge strings, is it?
|
* called with huge strings, is it?
|
||||||
*/
|
*/
|
||||||
static gchar fatal_msg_buf[1000] = "Unspecified fatal error encountered, aborting.";
|
static gchar fatal_msg_buf[1000] = "Unspecified fatal error encountered, aborting.";
|
||||||
static gchar *fatal_msg_ptr = fatal_msg_buf;
|
|
||||||
|
|
||||||
#undef write
|
|
||||||
static inline int
|
|
||||||
dowrite (int fd,
|
|
||||||
const void *buf,
|
|
||||||
unsigned int len)
|
|
||||||
{
|
|
||||||
if (win32_keep_fatal_message)
|
|
||||||
{
|
|
||||||
memcpy (fatal_msg_ptr, buf, len);
|
|
||||||
fatal_msg_ptr += len;
|
|
||||||
*fatal_msg_ptr = 0;
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
write (fd, buf, len);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
#define write(fd, buf, len) dowrite(fd, buf, len)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -92,6 +92,8 @@ typedef struct { gchar bytes[8]; } gint64_be;
|
|||||||
typedef struct { gchar bytes[4]; } gint32_be;
|
typedef struct { gchar bytes[4]; } gint32_be;
|
||||||
typedef struct { gchar bytes[4]; } guint32_be;
|
typedef struct { gchar bytes[4]; } guint32_be;
|
||||||
|
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
|
|
||||||
static inline gint64 gint64_from_be (const gint64_be be) {
|
static inline gint64 gint64_from_be (const gint64_be be) {
|
||||||
gint64 tmp; memcpy (&tmp, &be, sizeof tmp); return GINT64_FROM_BE (tmp);
|
gint64 tmp; memcpy (&tmp, &be, sizeof tmp); return GINT64_FROM_BE (tmp);
|
||||||
}
|
}
|
||||||
@ -104,6 +106,8 @@ static inline guint32 guint32_from_be (const guint32_be be) {
|
|||||||
guint32 tmp; memcpy (&tmp, &be, sizeof tmp); return GUINT32_FROM_BE (tmp);
|
guint32 tmp; memcpy (&tmp, &be, sizeof tmp); return GUINT32_FROM_BE (tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The layout of an IANA timezone file header */
|
/* The layout of an IANA timezone file header */
|
||||||
struct tzhead
|
struct tzhead
|
||||||
{
|
{
|
||||||
|
@ -536,7 +536,7 @@ int
|
|||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if G_CXX_STD_CHECK_VERSION (11)
|
#if G_CXX_STD_CHECK_VERSION (11)
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, nullptr);
|
||||||
#else
|
#else
|
||||||
g_test_init (&argc, &argv, static_cast<void *>(NULL));
|
g_test_init (&argc, &argv, static_cast<void *>(NULL));
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,7 +44,7 @@ test_subst_pid_and_event (void)
|
|||||||
char *debugger_big_utf8;
|
char *debugger_big_utf8;
|
||||||
gchar *output;
|
gchar *output;
|
||||||
guintptr be = (guintptr) 0xFFFFFFFF;
|
guintptr be = (guintptr) 0xFFFFFFFF;
|
||||||
DWORD bp = G_MAXSIZE;
|
DWORD bp = MAXDWORD;
|
||||||
|
|
||||||
/* %f is not valid */
|
/* %f is not valid */
|
||||||
g_assert_false (_g_win32_subst_pid_and_event_w (debugger_3, G_N_ELEMENTS (debugger_3),
|
g_assert_false (_g_win32_subst_pid_and_event_w (debugger_3, G_N_ELEMENTS (debugger_3),
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/* Nb: this file might be included in a file compiled with -ansi. So
|
/* Nb: this file might be included in a file compiled with -ansi. So
|
||||||
we can't use C++ style "//" comments nor the "asm" keyword (instead
|
we can't use C++ style "//" comments nor the "asm" keyword (instead
|
||||||
@ -411,14 +412,14 @@ typedef
|
|||||||
_zzq_default, _zzq_request, \
|
_zzq_default, _zzq_request, \
|
||||||
_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
|
_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
|
||||||
__extension__ \
|
__extension__ \
|
||||||
({ volatile unsigned long int _zzq_args[6]; \
|
({ volatile uintptr_t _zzq_args[6]; \
|
||||||
volatile unsigned long int _zzq_result; \
|
volatile unsigned long int _zzq_result; \
|
||||||
_zzq_args[0] = (unsigned long int)(_zzq_request); \
|
_zzq_args[0] = (uintptr_t)(_zzq_request); \
|
||||||
_zzq_args[1] = (unsigned long int)(_zzq_arg1); \
|
_zzq_args[1] = (uintptr_t)(_zzq_arg1); \
|
||||||
_zzq_args[2] = (unsigned long int)(_zzq_arg2); \
|
_zzq_args[2] = (uintptr_t)(_zzq_arg2); \
|
||||||
_zzq_args[3] = (unsigned long int)(_zzq_arg3); \
|
_zzq_args[3] = (uintptr_t)(_zzq_arg3); \
|
||||||
_zzq_args[4] = (unsigned long int)(_zzq_arg4); \
|
_zzq_args[4] = (uintptr_t)(_zzq_arg4); \
|
||||||
_zzq_args[5] = (unsigned long int)(_zzq_arg5); \
|
_zzq_args[5] = (uintptr_t)(_zzq_arg5); \
|
||||||
__asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
|
__asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
|
||||||
/* %RDX = client_request ( %RAX ) */ \
|
/* %RDX = client_request ( %RAX ) */ \
|
||||||
"xchgq %%rbx,%%rbx" \
|
"xchgq %%rbx,%%rbx" \
|
||||||
|
Loading…
Reference in New Issue
Block a user