[fixed] [regression] several new compiler warnings in master

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[fixed] [regression] several new compiler warnings in master

Post by uwestoehr »

I see that our CI reports several new warnings:

https://github.com/FreeCAD/FreeCAD/acti ... 6001789549

Code: Select all

QuantityParser.c: In function ‘int QuantityParser::Quantity_yyparse()’:
QuantityParser.c:1738:18: warning: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonheap-object]
In file included from /home/runner/work/FreeCAD/FreeCAD/src/Base/Quantity.cpp:478:
QuantityParser.c:1081:18: note: declared here
In file included from /home/runner/work/FreeCAD/FreeCAD/src/App/Expression.cpp:3198:
ExpressionParser.tab.c: In function ‘int App::ExpressionParser::ExpressionParser_yyparse()’:
ExpressionParser.tab.c:2093:18: warning: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonheap-object]
In file included from /home/runner/work/FreeCAD/FreeCAD/src/App/Expression.cpp:3198:
ExpressionParser.tab.c:1202:18: note: declared here
/home/runner/work/FreeCAD/FreeCAD/src/Gui/CommandCompleter.cpp: In member function ‘virtual bool Gui::CommandCompleter::eventFilter(QObject*, QEvent*)’:
/home/runner/work/FreeCAD/FreeCAD/src/Gui/CommandCompleter.cpp:187:59: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = Qt::KeyboardModifier; QFlags<T>::Zero = int QFlags<Qt::KeyboardModifier>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  187 |                 QKeyEvent kevent(ke->type(),Qt::Key_Down,0);
      |                                                           ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1299,
                 from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/CommandCompleter.cpp:26:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Gui/CommandCompleter.cpp:195:57: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = Qt::KeyboardModifier; QFlags<T>::Zero = int QFlags<Qt::KeyboardModifier>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  195 |                 QKeyEvent kevent(ke->type(),Qt::Key_Up,0);
      |                                                         ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1299,
                 from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/CommandCompleter.cpp:26:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp: In member function ‘void Gui::Dialog::DlgDisplayPropertiesImp::setupConnections()’:
/home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:177:56: warning: ‘void QComboBox::activated(const QString&)’ is deprecated: Use textActivated() instead [-Wdeprecated-declarations]
  177 |     connect(d->ui.changeMode, qOverload<const QString&>(&QComboBox::activated), this, &DlgDisplayPropertiesImp::onChangeModeActivated);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QComboBox:1,
                 from /home/runner/work/FreeCAD/FreeCAD/build/src/Gui/FreeCADGui_autogen/include/ui_DlgDisplayProperties.h:14,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:34:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qcombobox.h:245:10: note: declared here
  245 |     void activated(const QString &);
      |          ^~~~~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:177:56: warning: ‘void QComboBox::activated(const QString&)’ is deprecated: Use textActivated() instead [-Wdeprecated-declarations]
  177 |     connect(d->ui.changeMode, qOverload<const QString&>(&QComboBox::activated), this, &DlgDisplayPropertiesImp::onChangeModeActivated);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QComboBox:1,
                 from /home/runner/work/FreeCAD/FreeCAD/build/src/Gui/FreeCADGui_autogen/include/ui_DlgDisplayProperties.h:14,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:34:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qcombobox.h:245:10: note: declared here
  245 |     void activated(const QString &);
      |          ^~~~~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:178:56: warning: ‘void QComboBox::activated(const QString&)’ is deprecated: Use textActivated() instead [-Wdeprecated-declarations]
  178 |     connect(d->ui.changePlot, qOverload<const QString&>(&QComboBox::activated), this, &DlgDisplayPropertiesImp::onChangePlotActivated);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QComboBox:1,
                 from /home/runner/work/FreeCAD/FreeCAD/build/src/Gui/FreeCADGui_autogen/include/ui_DlgDisplayProperties.h:14,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:34:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qcombobox.h:245:10: note: declared here
  245 |     void activated(const QString &);
      |          ^~~~~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:178:56: warning: ‘void QComboBox::activated(const QString&)’ is deprecated: Use textActivated() instead [-Wdeprecated-declarations]
  178 |     connect(d->ui.changePlot, qOverload<const QString&>(&QComboBox::activated), this, &DlgDisplayPropertiesImp::onChangePlotActivated);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QComboBox:1,
                 from /home/runner/work/FreeCAD/FreeCAD/build/src/Gui/FreeCADGui_autogen/include/ui_DlgDisplayProperties.h:14,
                 from /home/runner/work/FreeCAD/FreeCAD/src/Gui/DlgDisplayPropertiesImp.cpp:34:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qcombobox.h:245:10: note: declared here
  245 |     void activated(const QString &);
      |          ^~~~~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp: In constructor ‘SketcherGui::TaskSketcherConstraints::TaskSketcherConstraints(SketcherGui::ViewProviderSketch*)’:
/home/runner/work/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp:751:78: warning: ‘?:’ using integer constants in boolean context [-Wint-in-bool-context]
  751 |     ui->filterBox->setChecked(hGrp->GetBool("ConstraintFilterEnabled", true) ? Qt::Checked : Qt::Unchecked);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp: In constructor ‘SketcherGui::TaskSketcherElements::TaskSketcherElements(SketcherGui::ViewProviderSketch*)’:
/home/runner/work/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp:606:75: warning: ‘?:’ using integer constants in boolean context [-Wint-in-bool-context]
  606 |     ui->filterBox->setChecked(hGrp->GetBool("ElementFilterEnabled", true) ? Qt::Checked : Qt::Unchecked);
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can first have a proper look next weekend.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] several new compiler warnings in master

Post by uwestoehr »

wmayer wrote: Tue Nov 29, 2022 9:36 am git commit ad1cccdd27
Many thanks.

However, I cannot compile current master due to these errors:

Code: Select all

2>D:\FreeCAD-git\src\Base\Builder3D.cpp(142,5): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'Base::Indentation' (or there is no acceptable conversion)
2>D:\FreeCAD-git\src\Base\Builder3D.cpp(148,5): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'Base::Indentation' (or there is no acceptable conversion)
2>D:\FreeCAD-git\src\Base\Builder3D.cpp(154,15): message : 'initializing': cannot convert from 'Base::Indentation' to 'std::nullptr_t'
2>D:\FreeCAD-git\src\Base\Builder3D.cpp(160,5): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'Base::Indentation' (or there is no acceptable conversion)
2>D:\FreeCAD-git\src\Base\Builder3D.cpp(166,15): message : 'initializing': cannot convert from 'Base::Indentation' to 'std::nullptr_t'
...
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] several new compiler warnings in master

Post by uwestoehr »

wmayer wrote: Tue Nov 29, 2022 5:21 pm git commit c16b94c669
Many thanks. Confirmed fixed.
Post Reply