I tested trunk against a daily prerelease build of ubuntu 23.04, which has mingw-w64 12, and got a couple of warnings about a dangling pointer and a not ignored unused variable. So I made a patch that fixes these two issues.
Previous versions of mingw-w64 in ubuntu were based on gcc 10, but this is the first version of ubuntu (23.04) using the newer gcc 12 backend for mingw-w64.
Some research showed that other software revealed the same issues when they upgraded to gcc 12 proper.
Can we just add a define that references 'parms' indirectly and remove the global variable?
We don't want to pass that extra parameter in so many places.
What about just
static int *g_parms = 0;?Last edit: Anders 2023-04-12
First thing I tried, didn't work. Here is the warning from mingw-w64:
Previous versions of mingw-w64 in ubuntu were based on gcc 10, but this is the first version of ubuntu (23.04) using the newer gcc 12 backend for mingw-w64.
Some research showed that other software revealed the same issues when they upgraded to gcc 12 proper.
Can we just add a define that references 'parms' indirectly and remove the global variable?
All the functions using it are static and only called by that function so the pointer cannot dangle.
If you can't fool it with a
(int*)(char*)cast then ifdef GCC pragma/attribute away the warning.Last edit: Anders 2023-04-13
Alright.
I'll also attach an alternate patch that removes 'g_parms' and passes the parms through using defines, in case anyone else searches for this issue.