Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.4.1
-
None
-
None
-
OpenWrt, ARM Cortex-A9, GCC 14.2
Description
Since mariadb-connector-c is compiled with "-Werror" turned on, on 32-bit systems with ucontext it produces an error:
libmariadb/ma_context.c:106:3: error: 'u.a[1]' may be used uninitialized [-Werror=maybe-uninitialized] |
106 | makecontext(&c->spawned_context, (uc_func_t)my_context_spawn_internal, 2,
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
107 | u.a[0], u.a[1]);
|
| ~~~~~~~~~~~~~~~
|
libmariadb/ma_context.c:94:32: note: 'u.a[1]' was declared here |
94 | union pass_void_ptr_as_2_int u; |
| ^
|
cc1: all warnings being treated as errors
|
When I initialized this field right after its declaration, the error disappeared:
my_context_spawn(struct my_context *c, void (*f)(void *), void *d) |
{
|
int err; |
union pass_void_ptr_as_2_int u; |
u.a[1] = 0; // the fix |