Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

patch vs. compile-error wxPGFlags in trunk svn13676 with wxWidgets trunk

<< < (3/4) > >>

Miguel Gimenez:

--- Quote ---#if wxCHECK_VERSION(3, 1, 1)
--- End quote ---

--- Quote ---I have compiled wxwidgets 3.1.1
--- End quote ---

I hope both statements are wrong  :P , they should be 3.3.1.

Blauzahn will test with reinterpret_cast <FlagType> () or (FlagType) this evening.
gd_on, probably you can do it now.

EDIT: I have not compiled C::B with 3.3.1 yet, but all the wxWidgets samples crash on closing (tested with W7, 32 bits and monolithic DLL). If C::B compiled with wx3.3.1 crashes on closing may be due to this issue.

gd_on:
You are right. I should have written 3.3.1. I have corrected my previous post.
And of course, the patch should be with :

--- Code: ---#if wxCHECK_VERSION(3, 3, 1)
--- End code ---

Tested and looks OK

Miguel Gimenez:
Can you check with reinterpret_cast <FlagType> ()?

Thank you.

blauzahn:
reinterpret_cast also does not compile as I suspected.


--- Code: ---../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp: In member function 'void {anonymous}::wxsMyColourPropertyClass::Init(int, const wxColour&)':
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:210:37: warning: 'wxPGProperty::FlagType' is deprecated: use wxPGFlags type instead [-Wdeprecated-declarations]
  210 |         m_flags |= reinterpret_cast<FlagType>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
      |                                     ^~~~~~~~
In file included from /opt/wx/include/wx-3.3/wx/propgrid/propgrid.h:21,
                 from ../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/../../properties/wxsproperty.h:34,
                 from ../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/../../properties/wxsproperties.h:8,
                 from ../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.h:28,
                 from ../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:23:
/opt/wx/include/wx-3.3/wx/propgrid/property.h:1038:22: note: declared here
 1038 |     typedef wxUint32 FlagType;
      |                      ^~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:210:20: error: invalid cast from type 'int' to type 'wxPGProperty::FlagType' {aka 'unsigned int'}
  210 |         m_flags |= reinterpret_cast<FlagType>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:211:37: warning: 'wxPGProperty::FlagType' is deprecated: use wxPGFlags type instead [-Wdeprecated-declarations]
  211 |         m_flags |= reinterpret_cast<FlagType>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
      |                                     ^~~~~~~~
/opt/wx/include/wx-3.3/wx/propgrid/property.h:1038:22: note: declared here
 1038 |     typedef wxUint32 FlagType;
      |                      ^~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:211:20: error: invalid cast from type 'int' to type 'wxPGProperty::FlagType' {aka 'unsigned int'}
  211 |         m_flags |= reinterpret_cast<FlagType>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp: In member function 'virtual void {anonymous}::wxsMyColourPropertyClass::OnCustomPaint(wxDC&, const wxRect&, wxPGPaintData&)':
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:589:48: warning: 'wxPGProperty::FlagType' is deprecated: use wxPGFlags type instead [-Wdeprecated-declarations]
  589 |         else if ( !(m_flags & reinterpret_cast<FlagType>(wxPG_PROP_UNSPECIFIED)) )
      |                                                ^~~~~~~~
/opt/wx/include/wx-3.3/wx/propgrid/property.h:1038:22: note: declared here
 1038 |     typedef wxUint32 FlagType;
      |                      ^~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:589:31: error: invalid cast from type 'wxPG_EX_WINDOW_STYLES' to type 'wxPGProperty::FlagType' {aka 'unsigned int'}
  589 |         else if ( !(m_flags & reinterpret_cast<FlagType>(wxPG_PROP_UNSPECIFIED)) )
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp: In member function 'virtual bool {anonymous}::wxsMyColourPropertyClass::StringToValue(wxVariant&, const wxString&, int) const':
../../../../../../../trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp:674:57: warning: 'virtual bool wxEnumProperty::StringToValue(wxVariant&, const wxString&, int) const' is deprecated: use StringToValue with 'flags' argument as wxPGPropValFormatFlags [-Wdeprecated-declarations]
  674 |                 bool res = wxEnumProperty::StringToValue(value, colourName, argFlags);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/wx/include/wx-3.3/wx/propgrid/propgrid.h:2210:
/opt/wx/include/wx-3.3/wx/propgrid/props.h:519:18: note: declared here
  519 |     virtual bool StringToValue(wxVariant& variant, const wxString& text,
      |                  ^~~~~~~~~~~~~
make[7]: *** [Makefile:677: wxscolourproperty.lo] Fehler 1

--- End code ---

wxCHECK_VERSION seems to be used quite often in cb. Where do I find the minimum required version? Can't find it at first glance.
In case it is wxCHECK_VERSION(3, 0, 0) anyway, shouldn't those conditionals be updated, that is eliminated? I also like backwards
compatibility for some not too short time. That allows to update dependent projects like cb on their own pace and stepwise instead of
a big bang. Nice if indicated by [[deprecated]] and tools like clang-tidy [-modernize-...].

Thanks for the active contributions.

Miguel Gimenez:
We support wx3.0.x because it is the version included in some Linux distributions still in use (p.e. Mint 18 or Ubuntu 22.04).

Fixed in r13679, thank you.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version