Re[2]: Build warnings
Vadim Zeitlin <[email protected]> Thu, 4 Jun 2026 14:58:41 +0200
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1562402336-1780577921=:2040883
Content-Type: TEXT/PLAIN; CHARSET=UTF-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: INLINE
On Wed, 3 Jun 2026 23:08:57 -0700 (PDT) =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=
=B9 =D0=9A=D0=BE=D0=BD=D1=8B=D0=B3=D0=B8=D0=BD wrote:
=D0=A1=D0=9A> ../../src/common/numformatter.cpp: In static member function =
'static=20
=D0=A1=D0=9A> wxString wxNumberFormatter::RemoveCurrencySymbolOrCode(wxStri=
ng, int)':
=D0=A1=D0=9A> ../../src/common/numformatter.cpp:355:32: warning: this state=
ment may fall=20
=D0=A1=D0=9A> through [-Wimplicit-fallthrough=3D]
=D0=A1=D0=9A> 355 | currencyStr +=3D wxString(" ");
=D0=A1=D0=9A> | ^~~~~~~~~~~~~
This (and other -Wimplicit-fallthrough) warnings are strange, it looks
like wxFALLTHROUGH is not defined correctly somehow for you. As the other
warnings below indicate, you are using C++20 (or later), so it should be
defined as [[fallthrough]] and no warning should be given then.
=D0=A1=D0=9A> In file included from ../../src/msw/settings.cpp:34:
=D0=A1=D0=9A> ..\..\include/wx/msw/private/metrics.h: In function 'bool=20
=D0=A1=D0=9A> wxMSWImpl::IsHighContrast()':
=D0=A1=D0=9A> ..\..\include/wx/msw/private/metrics.h:43:36: warning: missin=
g initializer=20
=D0=A1=D0=9A> for member 'tagHIGHCONTRASTW::dwFlags' [-Wmissing-field-initi=
alizers]
=D0=A1=D0=9A> 43 | HIGHCONTRAST hc =3D { sizeof(hc) };
=D0=A1=D0=9A> | ^
This has been already fixed in dcec891a5c (Use WinStruct<> instead of
manually initializing HIGHCONTRAST, 2026-04-18).
=D0=A1=D0=9A> ../../src/msw/joystick.cpp: In lambda function:
=D0=A1=D0=9A> ../../src/msw/joystick.cpp:438:27: warning: implicit capture =
of 'this' via=20
=D0=A1=D0=9A> '[=3D]' is deprecated in C++20 [-Wdeprecated]
=D0=A1=D0=9A> 438 | auto GetNameFromReg =3D [=3D](wxRegKey::StdKey ro=
ot) -> wxString
=D0=A1=D0=9A> | ^
=D0=A1=D0=9A> ../../src/msw/joystick.cpp:438:27: note: add explicit 'this' =
or '*this'=20
=D0=A1=D0=9A> capture
This needs to be fixed, but it's a bit tricky because we can't capture
"this" explicitly when using earlier C++ standards, so we'd need to add
something like
#if wxCHECK_CXX_STD(202002L)
#define wxCAPTURE_THIS , this
#else
#define wxCAPTURE_THIS
#endif
and then use it like this
auto GetNameFromReg =3D [=3D wxCAPTURE_THIS](wxRegKey::StdKey root) -> =
wxString
=D0=A1=D0=9A> ../../src/msw/darkmode.cpp: In instantiation of 'bool=20
=D0=A1=D0=9A> {anonymous}::TryLoadByOrd(T&, const wxDynamicLibrary&, int) [=
with T =3D bool=20
=D0=A1=D0=9A> (__attribute__((stdcall)) *)()]':
=D0=A1=D0=9A> ../../src/msw/darkmode.cpp:197:24: required from here
=D0=A1=D0=9A> 197 | return TryLoadByOrd(ShouldAppsUseDarkMode, dllUxT=
heme, 132) &&
=D0=A1=D0=9A> | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~
=D0=A1=D0=9A> ../../src/msw/darkmode.cpp:154:12: warning: cast between inco=
mpatible=20
=D0=A1=D0=9A> function types from 'FARPROC' {aka 'int (__attribute__((stdca=
ll)) *)()'} to=20
=D0=A1=D0=9A> 'bool (__attribute__((stdcall)) *)()' [-Wcast-function-type]
We'll have to suppress this warning, there is no way around it.
The goal is for wx to build without warnings, but it's not always simple
to achieve due to the number of compilers and build options. If you
encounter warnings, please open issues for them and, if you can, make PRs
to fix them.
Regards,
VZ
--=20
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
--8323329-1562402336-1780577921=:2040883
Content-Type: APPLICATION/PGP-SIGNATURE
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaiF2gQAKCRAG6kHeT2we
hmuxAJwLM4H22zUzvAf2Wc/DScP71RbnCwCfVN7ejH92vHoIH7kQZqnm1TwPHWg=
=bFy/
-----END PGP SIGNATURE-----
--8323329-1562402336-1780577921=:2040883--