You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Same environment and test program as #48121, but with -Wsign-conversion and -Wshorten-64-to-32:
gcc_sigaction.c:55:33: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
gcc_sigaction.c:77:28: error: implicit conversion changes signedness: 'int' to 'uint64_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
gcc_sigaction.c:52:30: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
gcc_sigaction.c:55:31: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
gcc_sigaction.c:58:18: error: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
gcc_sigaction.c:73:38: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
The text was updated successfully, but these errors were encountered:
elagergren-spideroak
changed the title
runtime/cgo: cannot build with -Wsign-conversion or -Wshorten-64-to-32
runtime/cgo: cannot build with -Wsign-conversion
Sep 1, 2021
elagergren-spideroak
changed the title
runtime/cgo: cannot build with -Wsign-conversion
runtime/cgo: cannot build with -Wsign-conversion or -Wshorten-64-to-32
Sep 1, 2021
Some GCC output directly from CI (code is different from the minimal repro in #48121):
GCC 8 and 9:
cgo-gcc-prolog:6:74: error: unsigned conversion from ?int? to ?long unsigned int? changes value from ?-2? to ?18446744073709551614? [-Werror=sign-conversion]
cgo-gcc-prolog:9:33: note: in expansion of macro ?__cgo_compile_assert_eq?
cgo-gcc-prolog:11:1: note: in expansion of macro ?__cgo_size_assert?
gcc_sigaction.c: In function 'x_cgo_sigaction':
gcc_sigaction.c:52:30: error: conversion from 'size_t' {aka 'long unsigned int'} to 'int' may change value [-Werror=conversion]
sigaddset(&act.sa_mask, i+1);
~^~
gcc_sigaction.c:55:18: error: conversion from 'long unsigned int' to 'int' may change value [-Werror=conversion]
act.sa_flags = goact->flags & ~SA_RESTORER;
^~~~~
gcc_sigaction.c:58:18: error: conversion from 'intptr_t' {aka 'long int'} to 'int' may change value [-Werror=conversion]
ret = sigaction(signum, goact ? &act : NULL, oldgoact ? &oldact : NULL);
^~~~~~
gcc_sigaction.c:73:38: error: conversion from 'size_t' {aka 'long unsigned int'} to 'int' may change value [-Werror=conversion]
if (sigismember(&oldact.sa_mask, i+1) == 1) {
Same environment and test program as #48121, but with
-Wsign-conversion
and-Wshorten-64-to-32
:The text was updated successfully, but these errors were encountered: