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.
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).
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.
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.
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).
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.
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.
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.