Commit Graph

19 Commits

Author SHA1 Message Date
Vadim Zeitlin
9aaadab7d6 Check for most clang warnings in our headers in the test suite
Make allheaders unit test also enable -Wall, -Wextra and -Wpedantic for
clang to detect any warnings it might give in wx headers.

Don't use -Weverything because there are just too many warnings we'd
need to disable then.
2021-12-15 17:50:55 +01:00
Vadim Zeitlin
3d7f9877fb Predefine __USE_W32_SOCKETS for Cygwin in allheaders test
This is required to avoid warnings (and worse, probably) due to
conflicting function declarations in the platform SDK and Cygwin headers
that have started happening since 8dfcb582da (Regenerate configure after
enabling IPv6 support by default, 2021-06-15).
2021-06-15 16:44:24 +01:00
Vadim Zeitlin
c0f2430ee4 Correct misleading comment in allheaders test
We don't use any HAVE_XXX here, but we do use wxUSE_XXX.
2021-06-15 14:50:37 +02:00
Vadim Zeitlin
0a166474f8 Don't include MSW headers in allheaders test
This extends the changes of e0005c1d93 (No longer include the system
headers first, 2021-04-22) to the platform-specific headers included for
Cygwin/MinGW wxMSW builds, as this shouldn't be necessary neither any
more (but doing it for wxQt is still needed, for the reasons explained
in the new comment added by this commit).

It also incidentally fixes a problem in Cygwin build since enabling IPv6
in 8dfcb582da (Regenerate configure after enabling IPv6 support by
default, 2021-06-15) as including unistd.h directly results in warnings
if wx/defs.h, which predefines __USE_W32_SOCKETS, hadn't been included
before.
2021-06-15 14:50:37 +02:00
Vadim Zeitlin
95c98a0b5f Work around -Wuggest-override for event table macros from gcc 11
Disabling -Wsuggest-override inside macros is broken in gcc, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578, and has started
affecting wxWARNING_SUPPRESS_MISSING_OVERRIDE since gcc 11, i.e. this
macro doesn't have any effect any more and the warning is still given.

Avoid it by actually specifying "override" for gcc 11 (as doing it for
all compilers would result in -Winconsistent-missing-override from
clang) and check that we don't get this warning in the allheaders test.

Also don't use wxDECLARE_ABSTRACT_CLASS() inside wxObject itself, now
that it uses "override", which is not appropriate for the base class
version. This is arguably more clear and should have been done like this
since the beginning anyhow.
2021-04-26 11:55:33 +02:00
Ian McInerney
e0005c1d93 No longer include the system headers first
With the Wsystem-headers warning removed, these are no longer needed
and can instead be included on first-use again.
2021-04-22 19:23:48 +01:00
Ian McInerney
b47189b945 Don't enable warnings in the system headers during all headers test
This warning flag is really only used for stdlib debugging/writing,
and is off by default so that normal users of the library don't see
any warnings generated by the library (since they have no control
over it).
2021-04-22 19:22:32 +01:00
Vadim Zeitlin
9824d3bef3 Don't try testing wxNO_IMPLICIT_WXSTRING_ENCODING in ANSI build
This doesn't work and this won't change.
2020-10-18 20:15:14 +02:00
Paul Cornett
4ebfe0059a Pre-include another header for Cygwin
Avoid -Wpedantic warning for extra ';'
2020-09-13 08:27:45 -07:00
Vadim Zeitlin
2a17eef2ed Pre-include even more standard headers with MinGW/Cygwin
Avoid -Wredundant-decls when including them later by pre-including them
before enabling this warning.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
03bc49de2d Include <windows.h> before enabling all the warnings
This avoids tons of -Wredundant-decls and -Wnon-virtual-dtor (given for
all OLE interfaces).
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
6f9390306d Disable -Wsuggest-final-xxx in the headers for now
We don't use "final" in our code, as very few classes in wx code have
virtual functions but are not meant to be derived from in the user code.

Ideal would be to check the existing warnings and maybe apply "final" if
it's relevant and disable it otherwise, as these warnings can be useful
to build the application code with, but for now just disable them in the
test suite.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
3bbefcdd74 Don't trigger warnings in standard headers when building wxQt
Pre-include QFont header in wxQt to avoid warnings for the other headers
included from it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
266c3a962f Disable -Winline as we can't ensure all functions are inlined
It doesn't really make sense to enable this for C++ code, with a lot of
implicitly inline functions.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
1861065ef2 Disable -Wformat in system headers
This is given for the use of %zu by gcc 5.4.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
23334af81b Test headers compilation with maximum warnings options with gcc
As wx headers are included from user applications which may compile with
higher warning level than wx itself, try to check headers compilation
with almost all of gcc warning flags turned on.

This notably should prevent the headers from becoming uncompilable with
-pedantic again in the future.
2020-08-31 01:24:57 +02:00
Vadim Zeitlin
30fc873626 Remove useless hdrstop pragma from allheaders test
It shouldn't be necessary for a test not using PCH at all and Borland
compiler is almost certainly not supported anyhow any longer.
2020-08-25 16:54:23 +02:00
Arrigo Marchiori
464aeb8f84 avoid using wxNO_IMPLICIT_WXSTRING_ENCODING in utf-8-only builds 2020-07-17 17:52:16 +02:00
Arrigo Marchiori
40d1a3da35 Test building all headers with wxNO_IMPLICIT_WXSTRING_ENCODING
Check that all our public headers compile with this macro defined and
that using a char string without specifying its expected encoding
results in the expected compilation failure in this case.
2020-07-17 17:52:16 +02:00