GCC warnings.

This commit is contained in:
Roman Telezhynskyi 2021-09-25 12:42:28 +03:00
parent 73861dedd5
commit 1b3e133309
14 changed files with 23 additions and 16 deletions

View File

@ -424,7 +424,7 @@ g++7:GCC_DEBUG_CXXFLAGS += \
-Wrestrict \ -Wrestrict \
-Walloc-zero \ -Walloc-zero \
-Wnonnull \ -Wnonnull \
-Wstringop-overflow=0 # cannot suppress warning in Qt headers -Wno-stringop-overflow # cannot suppress warning in Qt headers
# Since GCC 8 # Since GCC 8
g++8:GCC_DEBUG_CXXFLAGS += \ g++8:GCC_DEBUG_CXXFLAGS += \

View File

@ -35,7 +35,7 @@ public:
}; };
//container class to store entites. //container class to store entites.
class dx_ifaceBlock : public DRW_Block { class dx_ifaceBlock final : public DRW_Block {
public: public:
dx_ifaceBlock() dx_ifaceBlock()
: ent() : ent()

View File

@ -115,7 +115,7 @@ private:
* Class to handle dim style symbol table entries * Class to handle dim style symbol table entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_Dimstyle : public DRW_TableEntry { class DRW_Dimstyle final : public DRW_TableEntry {
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_Dimstyle() DRW_Dimstyle()
@ -343,7 +343,7 @@ private:
* Class to handle layer symbol table entries * Class to handle layer symbol table entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_Layer : public DRW_TableEntry { class DRW_Layer final : public DRW_TableEntry {
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_Layer() DRW_Layer()
@ -410,7 +410,7 @@ public:
* Class to handle text style symbol table entries * Class to handle text style symbol table entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_Textstyle : public DRW_TableEntry { class DRW_Textstyle final : public DRW_TableEntry {
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_Textstyle() DRW_Textstyle()
@ -453,7 +453,7 @@ public:
* Class to handle vport symbol table entries * Class to handle vport symbol table entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_Vport : public DRW_TableEntry { class DRW_Vport final : public DRW_TableEntry {
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_Vport() DRW_Vport()
@ -545,7 +545,7 @@ public:
* Class to handle image definitions object entries * Class to handle image definitions object entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_ImageDef : public DRW_TableEntry {// class DRW_ImageDef final : public DRW_TableEntry {//
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_ImageDef() DRW_ImageDef()
@ -590,7 +590,7 @@ public:
* Class to handle AppId symbol table entries * Class to handle AppId symbol table entries
* @author Rallaz * @author Rallaz
*/ */
class DRW_AppId : public DRW_TableEntry { class DRW_AppId final : public DRW_TableEntry {
SETOBJFRIENDS SETOBJFRIENDS
public: public:
DRW_AppId() { reset();} DRW_AppId() { reset();}

View File

@ -47,7 +47,7 @@ class VArcData;
/** /**
* @brief VArc class for anticlockwise arc. * @brief VArc class for anticlockwise arc.
*/ */
class VArc: public VAbstractArc class VArc final : public VAbstractArc
{ {
Q_DECLARE_TR_FUNCTIONS(VArc) Q_DECLARE_TR_FUNCTIONS(VArc)
public: public:

View File

@ -43,7 +43,7 @@
class VCubicBezierData; class VCubicBezierData;
class VCubicBezier : public VAbstractCubicBezier class VCubicBezier final : public VAbstractCubicBezier
{ {
public: public:
VCubicBezier(); VCubicBezier();

View File

@ -41,7 +41,7 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
class VCubicBezierData : public QSharedData class VCubicBezierData final : public QSharedData
{ {
public: public:
VCubicBezierData(); VCubicBezierData();

View File

@ -31,6 +31,7 @@ QT_WARNING_DISABLE_GCC("-Wold-style-cast")
QT_WARNING_DISABLE_CLANG("-Wold-style-cast") QT_WARNING_DISABLE_CLANG("-Wold-style-cast")
QT_WARNING_DISABLE_GCC("-Wcast-qual") QT_WARNING_DISABLE_GCC("-Wcast-qual")
QT_WARNING_DISABLE_CLANG("-Wcast-qual") QT_WARNING_DISABLE_CLANG("-Wcast-qual")
QT_WARNING_DISABLE_GCC("-Walloc-zero")
#if PREDICATE == EXACT_PREDICATE #if PREDICATE == EXACT_PREDICATE
extern void exactinit(); extern void exactinit();

View File

@ -80,6 +80,8 @@ private:
Q_DISABLE_COPY(VBoolProperty) Q_DISABLE_COPY(VBoolProperty)
}; };
VPE_MARK_NONFINAL_CLASS(VBoolProperty)
} }
#endif // VBOOLPROPERTY_H #endif // VBOOLPROPERTY_H

View File

@ -74,6 +74,8 @@ private:
Q_DISABLE_COPY(VColorProperty) Q_DISABLE_COPY(VColorProperty)
}; };
VPE_MARK_NONFINAL_CLASS(VColorProperty)
} }
#endif // VCOLORPROPERTY_H #endif // VCOLORPROPERTY_H

View File

@ -87,6 +87,8 @@ private:
Q_DISABLE_COPY(VEmptyProperty) Q_DISABLE_COPY(VEmptyProperty)
}; };
VPE_MARK_NONFINAL_CLASS(VEmptyProperty)
} }
#endif // VEMPTYPROPERTY_H #endif // VEMPTYPROPERTY_H

View File

@ -81,6 +81,8 @@ private:
Q_DISABLE_COPY(VShortcutProperty) Q_DISABLE_COPY(VShortcutProperty)
}; };
VPE_MARK_NONFINAL_CLASS(VShortcutProperty)
} }
#endif // VFILEPROPERTY_H #endif // VFILEPROPERTY_H

View File

@ -46,7 +46,7 @@ namespace Ui
/** /**
* @brief The DialogArc class dialog for ToolArc. Help create arc and edit option. * @brief The DialogArc class dialog for ToolArc. Help create arc and edit option.
*/ */
class DialogArc : public DialogTool class DialogArc final : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -43,7 +43,7 @@ namespace Ui
class DialogArcWithLength; class DialogArcWithLength;
} }
class DialogArcWithLength : public DialogTool class DialogArcWithLength final : public DialogTool
{ {
Q_OBJECT Q_OBJECT

View File

@ -39,9 +39,7 @@ VCurvePathItem::VCurvePathItem(QGraphicsItem *parent)
m_directionArrows(), m_directionArrows(),
m_points(), m_points(),
m_defaultWidth(VAbstractApplication::VApp()->Settings()->WidthMainLine()) m_defaultWidth(VAbstractApplication::VApp()->Settings()->WidthMainLine())
{ {}
SCASSERT(parent != nullptr);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QPainterPath VCurvePathItem::shape() const QPainterPath VCurvePathItem::shape() const