On Wed, 2020-06-10 at 10:26 -0500, Richard Shaw wrote:
I'm working on the ability to produce Windows builds of fldigi
using
the Fedora MinGW stack.
Currently the 32bit builds compile with little to no warnings and
appear to function properly, however, on 64bit builds there is a ton
more warnings (I have to use -fpermissive) and the program segfaults
shortly after launching.
I have tried to capture a gdb stack trace but it produces no results... zero.
The most common cause of this is work-size incorrectness, e.g. misuse
of LONG vs long, deprecated use of DWORD vs DWORD_PTR, etc. in variable
types being passed to (or returned from) Win32 APIs. Those warnings
might be indicative of such issues.
For instance:
dialogs/fl_digi.cxx: In function 'void cb_mnuVisitURL(Fl_Widget*, void*)':
dialogs/fl_digi.cxx:2616:68: error: cast from 'HINSTANCE' {aka
'HINSTANCE__*'} to 'int' loses precision [-fpermissive]
2616 | if ((int)ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL)
<= 32)
| ^
HINSTANCE is a pointer, so that's to be expected. Even though the docs
say to cast to int, INT_PTR might be a safer choice here.
--
Yaakov Selkowitz
Senior Software Engineer - Platform Enablement
Red Hat, Inc.