lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] PATCH: tests build fixes for clang


From: Vadim Zeitlin
Subject: Re: [lmi] PATCH: tests build fixes for clang
Date: Sun, 7 Mar 2021 22:58:06 +0100

On Sun, 7 Mar 2021 20:41:56 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> Doesn't seem to build cleanly with MinGW-w64 gcc-8.3 .
[...]
GC> /opt/lmi/src/lmi/census_view.cpp: In constructor 
‘wxFloatingPointValidator<T>::wxFloatingPointValidator(wxFloatingPointValidator<T>::ValueType*,
 int) [with T = double; wxFloatingPointValidator<T>::ValueType = double]’:
GC> /opt/lmi/src/lmi/census_view.cpp:127:42: error: zero as null pointer 
constant [-Werror=zero-as-null-pointer-constant]
GC>          wxFloatingPointValidator<double> val;
GC>                                           ^~~
GC> /opt/lmi/src/lmi/census_view.cpp: In member function ‘void 
wxEvtHandler::Bind(const EventTag&, const Functor&, int, int, wxObject*) [with 
EventTag = wxEventTypeTag<wxKeyEvent>; Functor = 
{anonymous}::DatumSequenceEditor::Create(wxWindow*, wxWindowID, 
wxEvtHandler*)::<lambda(wxKeyEvent&)>]’:
GC> /opt/lmi/src/lmi/census_view.cpp:234:10: error: zero as null pointer 
constant [-Werror=zero-as-null-pointer-constant]
GC>          });
GC>           ^
GC> /opt/lmi/src/lmi/skeleton.cpp: In member function ‘void 
wxEvtHandler::Bind(const EventTag&, void (Class::*)(EventArg&), EventHandler*, 
int, int, wxObject*) [with EventTag = wxEventTypeTag<wxMenuEvent>; Class = 
Skeleton; EventArg = wxMenuEvent; EventHandler = Skeleton]’:
GC> /opt/lmi/src/lmi/skeleton.cpp:750:68: error: zero as null pointer constant 
[-Werror=zero-as-null-pointer-constant]
GC>          frame_->Bind(wxEVT_MENU_OPEN, &Skeleton::UponMenuOpen, this);
GC>                                                                     ^
GC> cc1plus: all warnings being treated as errors
GC> make[1]: *** [/opt/lmi/src/lmi/workhorse.make:968: census_view.o] Error 1
GC> cc1plus: all warnings being treated as errors
GC> make[1]: *** [/opt/lmi/src/lmi/workhorse.make:968: skeleton.o] Error 1
GC> install -m 0775 lmi_md5sum.exe /opt/lmi/local/gcc_x86_64-w64-mingw32/bin
GC> make[1]: Target 'install' not remade because of errors.
GC> make: *** [GNUmakefile:241: /opt/lmi/gcc_x86_64-w64-mingw32/build/ship] 
Error 2
GC> make: Target 'install' not remade because of errors.
GC> make: Target 'check_physical_closure' not remade because of errors.
GC> 
GC> It looks like 32-bit MinGW-w64 gcc-8.3 gives the same errors.

 Oops, sorry, this change was so simple that I didn't recheck the build
with this compiler and just relied on the build with MinGW 10.1 passing
locally and the CI build (which uses MinGW 9.3) passing as well.

 But my change was indeed wrong, LMI_GCC can't be used in pchfile_wx.hpp
because it's included before config.hpp. The simplest fix would be to undo
the change to this file, but I wonder if I should add a gcc version check
instead: it seems that these particular -Wzero-as-null-pointer-constant
occurrences were due to a bug which was fixed in gcc 9 and later, so
perhaps we should only disable this warning for gcc < 9 and remove it once
we require a later gcc version? Or should we keep things simple and disable
it always?

 What would you prefer?
VZ

Attachment: pgpcPZTWzu6jl.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]