Projekt

Allgemein

Profil

Aktionen

Bug #231

geschlossen

Inconsistent use of GWENHYFAR_CB causes build failures on Windows

Von jralls@ceridwen.us vor mehr als 4 Jahren hinzugefügt. Vor mehr als 4 Jahren aktualisiert.

Status:
Closed
Priorität:
Normal
Kategorie:
Gwenhywfar
Beginn:
11.02.2021
Abgabedatum:
Betriebssystem:
Windows
AqBanking-Version:
Gwenhywfar 5.5.0, current git master
Anwendung:
GnuCash
Version der Anwendung:

Beschreibung

The following example errors are repeated for _freeData, _messageBox, _inputBox, _showBox, _hideBox, _progressStart, _progressAdvance, _progressSetTotal, _progressLog, _progressEnd, _print, _getPassword, _setPasswordStatus, _logHook, _waitForSockets, _checkCert, _keyDataFromTextOpenSsl, _execDialog, _openDialog, _closeDialog, _runDialog, _readDialogPrefs, _writeDialogPrefs, _getFilename, and _getSyncio:

C:/gcdev64/gnucash/maint/src/gwenhywfar-5.5.0/src/gui/nogui.c:192:52: warning: passing argument 2 of 'GWEN_Gui_SetMessageBoxFn' from incompatible pointer type [-Wincompatible-pointer-types]
192 | xgui->messageBoxFn=GWEN_Gui_SetMessageBoxFn(gui, _messageBox); | ^~~~~~~~~ | | | int (attribute((stdcall)) *)(GWEN_GUI *, uint32_t, const char *, const char *, const char *, const char *, const char *, uint32_t) {aka int (attribute((stdcall)) *)(GWEN_GUI *, unsigned int, const char *, const char *, const char *, const char *, const char *, unsigned int)}

C:/gcdev64/gnucash/maint/src/gwenhywfar-5.5.0/src/gui/nogui.c:233:5: error: conflicting types for '_messageBox'
233 | int _messageBox(GWEN_UNUSED GWEN_GUI *gui, | ^~~~~~~~~
C:/gcdev64/gnucash/maint/src/gwenhywfar-5.5.0/src/gui/nogui.c:49:26: note: previous declaration of '_messageBox' was here
49 | static int GWENHYWFAR_CB _messageBox(GWEN_GUI *gui, | ^~~~~~~~~

C:/gcdev64/gnucash/maint/src/gwenhywfar-5.5.0/src/gui/nogui.c:49:26: warning: '_messageBox' used but never defined
49 | static int GWENHYWFAR_CB _messageBox(GWEN_GUI *gui, | ^~~~~~~~~


Dateien

0001-Consistently-use-GWENHYWFAR_CB-in-callback-decls-and.patch (19 KB) 0001-Consistently-use-GWENHYWFAR_CB-in-callback-decls-and.patch Patch to fix all GWENHYWFAR_CB build errors on Windows. jralls@ceridwen.us, 11.02.2021 22:05
Aktionen #1

Von jralls@ceridwen.us vor mehr als 4 Jahren aktualisiert

Additional Functions in GWEN_Gui_ShowProgress, GWEN_Gui_DialogBased_ProgressStart, GWEN_Gui_DialogBased_ProgressEnd, GWEN_Gui_DialogBased_ProgressAdvance, GWEN_Gui_DialogBased_ProgressSetTotal, GWEN_Gui_DialogBased_Progress_Log, GWEN_Gui_DialogBased_InputBox,
GWEN_Gui_DialogBased_MessageBox, GWEN_Gui_DialogBased_ShowBox, GWEN_Gui_DialogBased_HideBox, and in testthread.c _freeData and _threadRun_cb.

Aktionen #2

Von martin vor mehr als 4 Jahren aktualisiert

  • Status wurde von New zu Closed geändert

Thanks, applied.

I don't usually compile the AqBanking family for Windows because it is a pain in the neck... However, I got it to cross-compile once with mingw under Linux (the depencies are hard to setup and compile in a cross-compile environment) but that didn't catch these missing GWENHYFAR_CB's...

So thanks for the patch!!

Aktionen #3

Von jralls@ceridwen.us vor mehr als 4 Jahren aktualisiert

BTW adding GWENHYWFAR_CB on the progress bar functions (and maybe others) is a breaking signature change on the public API: I had to do https://github.com/Gnucash/gnucash/commit/1993fb95306713e99bc4c906165347ecf901d62a to get GnuCash to compile on Windows. You didn't mention it in https://www.aquamaniac.de/rdm/news/27 so perhaps it wasn't intentional.

Aktionen #4

Von martin vor mehr als 4 Jahren aktualisiert

Hmm. These GWENHYWFAR_CB attributes should always have been there, I just didn't catch that they were missing because I seldomly compile on Windoze. Maybe I will have to increase the SO-version of GWEN due to this change...

Anyway: The reason why we introduced this attribute was that otherwise using callbacks from within apps compiled with VC (I believe) led to crashes because that compiler assumed other call characteristics regarding parameter storage on the stack. But that was a long time ago. Does anyone know whether this is still necessary?

Aktionen #5

Von jralls@ceridwen.us vor mehr als 4 Jahren aktualisiert

Well, calling conventions are still a thing, https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html and https://docs.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-160. It probably only matters when the library is compiled with different flags (or a different compiler) from the caller passing the callback. It obviously doesn't matter when both are compiled with gcc and the same CFLAGs because it's worked in GnuCash without the attribute.

Aktionen

Auch abrufbar als: Atom PDF