From c11f9d4548f6f197173ca734ee0792acf617ed7a Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sun, 1 Mar 2026 20:56:47 -0700 Subject: [PATCH 1/5] Updated code to use override,, dropped -Wno-inconsistent-missing-override. --- AISConnect.h | 4 ++-- Array.h | 2 +- AttrTable.h | 2 +- Byte.h | 2 +- D4Attributes.h | 4 ++-- D4BaseTypeFactory.h | 28 +++++++++++------------ D4Enum.h | 2 +- D4Group.h | 2 +- D4Sequence.h | 2 +- D4StreamUnMarshaller.h | 2 +- DAS.h | 2 +- DDS.h | 2 +- DataDDS.h | 2 +- Float32.h | 2 +- Float64.h | 2 +- Grid.h | 2 +- Int16.h | 2 +- Int32.h | 2 +- Int64.h | 2 +- Int8.h | 2 +- Makefile.am | 4 +++- StdinResponse.h | 10 ++++---- Str.h | 2 +- Structure.h | 2 +- UInt16.h | 2 +- UInt32.h | 2 +- UInt64.h | 2 +- Url.h | 4 ++-- Vector.h | 2 +- XDRFileMarshaller.h | 2 +- XDRFileUnMarshaller.h | 2 +- XDRStreamMarshaller.h | 2 +- XDRStreamUnMarshaller.h | 2 +- d4_ce/Makefile.am | 4 +++- d4_function/Makefile.am | 4 +++- tests/D4TestFunction.h | 2 +- tests/D4TestTypeFactory.h | 48 +++++++++++++++++++-------------------- tests/Makefile.am | 4 +++- tests/TestArray.h | 12 +++++----- tests/TestByte.h | 12 +++++----- tests/TestD4Enum.h | 12 +++++----- tests/TestD4Group.h | 12 +++++----- tests/TestD4Opaque.h | 12 +++++----- tests/TestD4Sequence.h | 16 ++++++------- tests/TestFloat32.h | 12 +++++----- tests/TestFloat64.h | 12 +++++----- tests/TestFunction.h | 2 +- tests/TestGrid.h | 12 +++++----- tests/TestInt16.h | 12 +++++----- tests/TestInt32.h | 12 +++++----- tests/TestInt64.h | 12 +++++----- tests/TestInt8.h | 12 +++++----- tests/TestSequence.h | 16 ++++++------- tests/TestStr.h | 12 +++++----- tests/TestStructure.h | 14 ++++++------ tests/TestTypeFactory.h | 28 +++++++++++------------ tests/TestUInt16.h | 12 +++++----- tests/TestUInt32.h | 12 +++++----- tests/TestUInt64.h | 12 +++++----- tests/TestUrl.h | 12 +++++----- unit-tests/Makefile.am | 4 +++- 61 files changed, 232 insertions(+), 222 deletions(-) diff --git a/AISConnect.h b/AISConnect.h index 68d100a23..7ea331e97 100644 --- a/AISConnect.h +++ b/AISConnect.h @@ -56,9 +56,9 @@ class AISConnect : public Connect { AISConnect(const string &name) throw(AISDatabaseReadFailed); AISConnect(const string &name, const string &ais_db) throw(AISDatabaseReadFailed); - virtual ~AISConnect(); + ~AISConnect() override; - virtual void request_das(DAS &das); + void request_das(DAS &das) override; }; } // namespace libdap diff --git a/Array.h b/Array.h index ae3bfd6d8..4e8a476b9 100644 --- a/Array.h +++ b/Array.h @@ -227,7 +227,7 @@ class Array : public Vector { Array(const string &n, BaseType *v, bool is_dap4 = false); Array(const string &n, const string &d, BaseType *v, bool is_dap4 = false); Array(const Array &rhs); - virtual ~Array(); + ~Array() override; Array &operator=(const Array &rhs); BaseType *ptr_duplicate() override; diff --git a/AttrTable.h b/AttrTable.h index 74303058a..cf15aed45 100644 --- a/AttrTable.h +++ b/AttrTable.h @@ -283,7 +283,7 @@ class AttrTable : public DapObj { public: AttrTable(); AttrTable(const AttrTable &rhs); - virtual ~AttrTable(); + ~AttrTable() override; AttrTable &operator=(const AttrTable &rhs); virtual void erase(); diff --git a/Byte.h b/Byte.h index a695acd4a..fed2f7e0e 100644 --- a/Byte.h +++ b/Byte.h @@ -64,7 +64,7 @@ class Byte : public BaseType { Byte(const string &n); Byte(const string &n, const string &d); - virtual ~Byte() {} + ~Byte() override {} Byte(const Byte ©_from); diff --git a/D4Attributes.h b/D4Attributes.h index a03a871c1..660e6bfed 100644 --- a/D4Attributes.h +++ b/D4Attributes.h @@ -65,7 +65,7 @@ class D4Attribute : public DapObj { D4Attribute(const string &name, D4AttributeType type) : d_name(name), d_type(type), d_attributes(0) {} D4Attribute(const D4Attribute &src); - ~D4Attribute(); + ~D4Attribute() override; D4Attribute &operator=(const D4Attribute &rhs); string name() const { return d_name; } @@ -116,7 +116,7 @@ class D4Attributes : public DapObj { D4Attributes() {} D4Attributes(const D4Attributes &rhs) { m_duplicate(rhs); } - virtual ~D4Attributes() { + ~D4Attributes() override { D4AttributesIter i = d_attrs.begin(); while (i != d_attrs.end()) { delete *i++; diff --git a/D4BaseTypeFactory.h b/D4BaseTypeFactory.h index 625c85437..9365c0214 100644 --- a/D4BaseTypeFactory.h +++ b/D4BaseTypeFactory.h @@ -71,42 +71,42 @@ class BaseType; class D4BaseTypeFactory : public BaseTypeFactory { public: D4BaseTypeFactory() {} - virtual ~D4BaseTypeFactory() {} + ~D4BaseTypeFactory() override {} - virtual BaseType *NewVariable(Type t, const string &name) const; + BaseType *NewVariable(Type t, const string &name) const override; - virtual BaseTypeFactory *ptr_duplicate() const { return new D4BaseTypeFactory; } + BaseTypeFactory *ptr_duplicate() const override { return new D4BaseTypeFactory; } - virtual Byte *NewByte(const string &n = "") const; + Byte *NewByte(const string &n = "") const override; // The Int8 types are new for DAP4 virtual Int8 *NewInt8(const string &n = "") const; virtual Byte *NewChar(const string &n = "") const; virtual Byte *NewUInt8(const string &n = "") const; - virtual Int16 *NewInt16(const string &n = "") const; - virtual UInt16 *NewUInt16(const string &n = "") const; - virtual Int32 *NewInt32(const string &n = "") const; - virtual UInt32 *NewUInt32(const string &n = "") const; + Int16 *NewInt16(const string &n = "") const override; + UInt16 *NewUInt16(const string &n = "") const override; + Int32 *NewInt32(const string &n = "") const override; + UInt32 *NewUInt32(const string &n = "") const override; // New for DAP4 virtual Int64 *NewInt64(const string &n = "") const; virtual UInt64 *NewUInt64(const string &n = "") const; - virtual Float32 *NewFloat32(const string &n = "") const; - virtual Float64 *NewFloat64(const string &n = "") const; + Float32 *NewFloat32(const string &n = "") const override; + Float64 *NewFloat64(const string &n = "") const override; virtual D4Enum *NewEnum(const string &n = "", Type type = dods_null_c) const; - virtual Str *NewStr(const string &n = "") const; - virtual Url *NewUrl(const string &n = "") const; + Str *NewStr(const string &n = "") const override; + Url *NewUrl(const string &n = "") const override; virtual Url *NewURL(const string &n = "") const; virtual D4Opaque *NewOpaque(const string &n = "") const; - virtual Array *NewArray(const string &n = "", BaseType *v = 0) const; + Array *NewArray(const string &n = "", BaseType *v = 0) const override; - virtual Structure *NewStructure(const string &n = "") const; + Structure *NewStructure(const string &n = "") const override; virtual D4Sequence *NewD4Sequence(const string &n = "") const; virtual D4Group *NewGroup(const string &n = "") const; diff --git a/D4Enum.h b/D4Enum.h index 0121cde02..2cc768c92 100644 --- a/D4Enum.h +++ b/D4Enum.h @@ -107,7 +107,7 @@ class D4Enum : public BaseType { return *this; } - virtual ~D4Enum() {} + ~D4Enum() override {} virtual D4EnumDef *enumeration() const { return d_enum_def; } virtual void set_enumeration(D4EnumDef *enum_def); diff --git a/D4Group.h b/D4Group.h index 582ebdbe7..c5463c91c 100644 --- a/D4Group.h +++ b/D4Group.h @@ -73,7 +73,7 @@ class D4Group : public Constructor { D4Group(const string &name, const string &dataset); D4Group(const D4Group &rhs); - virtual ~D4Group(); + ~D4Group() override; D4Group &operator=(const D4Group &rhs); diff --git a/D4Sequence.h b/D4Sequence.h index 156e83d61..97812e68d 100644 --- a/D4Sequence.h +++ b/D4Sequence.h @@ -170,7 +170,7 @@ class D4Sequence : public Constructor { D4Sequence(const D4Sequence &rhs); - virtual ~D4Sequence(); + ~D4Sequence() override; D4Sequence &operator=(const D4Sequence &rhs); diff --git a/D4StreamUnMarshaller.h b/D4StreamUnMarshaller.h index 17bad47a5..ee38bb240 100644 --- a/D4StreamUnMarshaller.h +++ b/D4StreamUnMarshaller.h @@ -87,7 +87,7 @@ class D4StreamUnMarshaller : public UnMarshaller { public: D4StreamUnMarshaller(istream &in, bool twiddle_bytes); D4StreamUnMarshaller(istream &in); - virtual ~D4StreamUnMarshaller(); + ~D4StreamUnMarshaller() override; void set_twiddle_bytes(bool twiddle) { d_twiddle_bytes = twiddle; } diff --git a/DAS.h b/DAS.h index dea874bd9..a2426a0dd 100644 --- a/DAS.h +++ b/DAS.h @@ -136,7 +136,7 @@ class DAS : public DapObj { DAS() : DapObj(), d_container(0) {} DAS(const DAS &das) { duplicate(das); } - virtual ~DAS() {} + ~DAS() override {} DAS &operator=(const DAS &rhs); diff --git a/DDS.h b/DDS.h index 2404b7115..4217af9a3 100644 --- a/DDS.h +++ b/DDS.h @@ -215,7 +215,7 @@ class DDS : public DapObj { DDS(BaseTypeFactory *factory, const string &name, const string &version); DDS(const DDS &dds); - virtual ~DDS(); + ~DDS() override; DDS &operator=(const DDS &rhs); diff --git a/DataDDS.h b/DataDDS.h index 73b8cbc67..1bff1fdd9 100644 --- a/DataDDS.h +++ b/DataDDS.h @@ -91,7 +91,7 @@ class DataDDS : public DDS { // #ifdef DEFAULT_BASETYPE_FACTORY // DataDDS(const string &n = "", const string &v = ""); // #endif - virtual ~DataDDS() {} + ~DataDDS() override {} /** Sets the version string. This typically looks something like: DODS/2.15, where ``2'' is the major version number, and ``15'' diff --git a/Float32.h b/Float32.h index fac166f2f..cf7f3875a 100644 --- a/Float32.h +++ b/Float32.h @@ -68,7 +68,7 @@ class Float32 : public BaseType { Float32 &operator=(const Float32 &rhs); - virtual ~Float32() {} + ~Float32() override {} BaseType *ptr_duplicate() override; diff --git a/Float64.h b/Float64.h index 4f76b905c..71bdc05df 100644 --- a/Float64.h +++ b/Float64.h @@ -62,7 +62,7 @@ class Float64 : public BaseType { public: Float64(const string &n); Float64(const string &n, const string &d); - virtual ~Float64() {} + ~Float64() override {} Float64(const Float64 ©_from); diff --git a/Grid.h b/Grid.h index 5f3a3883e..db8c06a35 100644 --- a/Grid.h +++ b/Grid.h @@ -130,7 +130,7 @@ class Grid : public Constructor { Grid(const string &n); Grid(const string &n, const string &d); Grid(const Grid &rhs); - virtual ~Grid(); + ~Grid() override; typedef std::vector::const_iterator Map_citer; typedef std::vector::iterator Map_iter; diff --git a/Int16.h b/Int16.h index 6fb0bf637..501fd764f 100644 --- a/Int16.h +++ b/Int16.h @@ -61,7 +61,7 @@ class Int16 : public BaseType { public: Int16(const string &n); Int16(const string &n, const string &d); - virtual ~Int16() {} + ~Int16() override {} Int16(const Int16 ©_from); diff --git a/Int32.h b/Int32.h index 6377ae086..859467f59 100644 --- a/Int32.h +++ b/Int32.h @@ -72,7 +72,7 @@ class Int32 : public BaseType { Int32 &operator=(const Int32 &rhs); - virtual ~Int32(); + ~Int32() override; BaseType *ptr_duplicate() override; diff --git a/Int64.h b/Int64.h index 3fb6d3bec..535ade789 100644 --- a/Int64.h +++ b/Int64.h @@ -67,7 +67,7 @@ class Int64 : public BaseType { Int64 &operator=(const Int64 &rhs); - virtual ~Int64(); + ~Int64() override; BaseType *ptr_duplicate() override; diff --git a/Int8.h b/Int8.h index a575c58db..624466f5b 100644 --- a/Int8.h +++ b/Int8.h @@ -57,7 +57,7 @@ class Int8 : public BaseType { public: Int8(const string &n); Int8(const string &n, const string &d); - virtual ~Int8() {} + ~Int8() override {} Int8(const Int8 ©_from); diff --git a/Makefile.am b/Makefile.am index dafafbf5d..c9c64e5dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,9 @@ aclocaldir=$(datadir)/aclocal pkgconfigdir=$(libdir)/pkgconfig AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl -I$(top_srcdir)/GNU -I$(top_srcdir)/http_dap $(XML2_CFLAGS) $(TIRPC_CFLAGS) -AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-deprecated-register -Wno-inconsistent-missing-override +AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-deprecated-register + +# jhrg 3/1/26 -Wno-inconsistent-missing-override CXXFLAGS_DEBUG = -g3 -O0 diff --git a/StdinResponse.h b/StdinResponse.h index 72f2638a6..bb5c2b596 100644 --- a/StdinResponse.h +++ b/StdinResponse.h @@ -65,13 +65,13 @@ class StdinResponse : public Response { StdinResponse(std::istream &in) : Response(), d_stdin(0), d_cin(&in) {} /** Destructor. Does not close standard input. */ - virtual ~StdinResponse() {} + ~StdinResponse() override {} - virtual FILE *get_stream() const { return d_stdin; } - virtual void set_stream(FILE *s) { d_stdin = s; } + FILE *get_stream() const override { return d_stdin; } + void set_stream(FILE *s) override { d_stdin = s; } - virtual std::istream *get_cpp_stream() const { return d_cin; } - virtual void set_cpp_stream(std::istream *in) { d_cin = in; } + std::istream *get_cpp_stream() const override { return d_cin; } + void set_cpp_stream(std::istream *in) override { d_cin = in; } }; } // namespace libdap diff --git a/Str.h b/Str.h index c0cb13b33..c123e28cf 100644 --- a/Str.h +++ b/Str.h @@ -66,7 +66,7 @@ class Str : public BaseType { Str(const string &n); Str(const string &n, const string &d); - virtual ~Str() {} + ~Str() override {} Str(const Str ©_from); diff --git a/Structure.h b/Structure.h index 7ea209c11..b6cc2d2f4 100644 --- a/Structure.h +++ b/Structure.h @@ -87,7 +87,7 @@ class Structure : public Constructor { Structure(const string &n, const string &d); Structure(const Structure &rhs); - virtual ~Structure(); + ~Structure() override; Structure &operator=(const Structure &rhs); BaseType *ptr_duplicate() override; diff --git a/UInt16.h b/UInt16.h index 68c6c3726..c69e73f58 100644 --- a/UInt16.h +++ b/UInt16.h @@ -59,7 +59,7 @@ class UInt16 : public BaseType { public: UInt16(const string &n); UInt16(const string &n, const string &d); - virtual ~UInt16() {} + ~UInt16() override {} UInt16(const UInt16 ©_from); diff --git a/UInt32.h b/UInt32.h index 3762932ba..5ebc363f7 100644 --- a/UInt32.h +++ b/UInt32.h @@ -61,7 +61,7 @@ class UInt32 : public BaseType { public: UInt32(const string &n); UInt32(const string &n, const string &d); - virtual ~UInt32() {} + ~UInt32() override {} UInt32(const UInt32 ©_from); diff --git a/UInt64.h b/UInt64.h index 57756b16c..f26fb409c 100644 --- a/UInt64.h +++ b/UInt64.h @@ -61,7 +61,7 @@ class UInt64 : public BaseType { public: UInt64(const string &n); UInt64(const string &n, const string &d); - virtual ~UInt64() {} + ~UInt64() override {} UInt64(const UInt64 ©_from); diff --git a/Url.h b/Url.h index 84222bae6..b21c2b363 100644 --- a/Url.h +++ b/Url.h @@ -59,9 +59,9 @@ class Url : public Str { Url(const std::string &n, const std::string &d); Url(const std::string &n, Type t); Url(const std::string &n, const std::string &d, Type t); - virtual ~Url() {} + ~Url() override {} - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; }; } // namespace libdap diff --git a/Vector.h b/Vector.h index 3281ef0b4..32118a90b 100644 --- a/Vector.h +++ b/Vector.h @@ -128,7 +128,7 @@ class Vector : public BaseType { Vector(const string &n, const string &d, BaseType *v, const Type &t, bool is_dap4 = false); Vector(const Vector &rhs); - virtual ~Vector(); + ~Vector() override; Vector &operator=(const Vector &rhs); // FIXME BaseType *ptr_duplicate() = 0 override; diff --git a/XDRFileMarshaller.h b/XDRFileMarshaller.h index 398782e2c..755c6a72c 100644 --- a/XDRFileMarshaller.h +++ b/XDRFileMarshaller.h @@ -50,7 +50,7 @@ class XDRFileMarshaller : public Marshaller { public: XDRFileMarshaller(FILE *out); - virtual ~XDRFileMarshaller(); + ~XDRFileMarshaller() override; void put_byte(dods_byte val) override; diff --git a/XDRFileUnMarshaller.h b/XDRFileUnMarshaller.h index 822e9eef4..edec398b0 100644 --- a/XDRFileUnMarshaller.h +++ b/XDRFileUnMarshaller.h @@ -51,7 +51,7 @@ class XDRFileUnMarshaller : public UnMarshaller { public: XDRFileUnMarshaller(FILE *out); - virtual ~XDRFileUnMarshaller(); + ~XDRFileUnMarshaller() override; void get_byte(dods_byte &val) override; diff --git a/XDRStreamMarshaller.h b/XDRStreamMarshaller.h index ffc7d48d7..8e182dfa3 100644 --- a/XDRStreamMarshaller.h +++ b/XDRStreamMarshaller.h @@ -70,7 +70,7 @@ class XDRStreamMarshaller : public Marshaller { public: XDRStreamMarshaller(ostream &out); //, bool checksum = false, bool write_data = true) ; - virtual ~XDRStreamMarshaller(); + ~XDRStreamMarshaller() override; void put_byte(dods_byte val) override; diff --git a/XDRStreamUnMarshaller.h b/XDRStreamUnMarshaller.h index fb9fbafbc..1ca99b308 100644 --- a/XDRStreamUnMarshaller.h +++ b/XDRStreamUnMarshaller.h @@ -62,7 +62,7 @@ class XDRStreamUnMarshaller : public UnMarshaller { public: XDRStreamUnMarshaller(istream &in); - virtual ~XDRStreamUnMarshaller(); + ~XDRStreamUnMarshaller() override; void get_byte(dods_byte &val) override; diff --git a/d4_ce/Makefile.am b/d4_ce/Makefile.am index aca8a0a04..39f33a41f 100644 --- a/d4_ce/Makefile.am +++ b/d4_ce/Makefile.am @@ -10,7 +10,9 @@ SUBDIRS = . unit-tests # Arrange to build with the backward compatibility mode enabled. AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce $(XML2_CFLAGS) $(TIRPC_CFLAGS) -AM_CXXFLAGS = -Wall -W -Wcast-align -Wno-inconsistent-missing-override +AM_CXXFLAGS = -Wall -W -Wcast-align + +# jhrg 3/1/26 -Wno-inconsistent-missing-override if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align diff --git a/d4_function/Makefile.am b/d4_function/Makefile.am index 0c33f5843..ee3ee3a43 100644 --- a/d4_function/Makefile.am +++ b/d4_function/Makefile.am @@ -5,7 +5,9 @@ AUTOMAKE_OPTIONS = foreign # Arrange to build with the backward compatibility mode enabled. AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce -I$(srcdir) $(XML2_CFLAGS) -AM_CXXFLAGS = -Wall -W -Wcast-align -Wno-inconsistent-missing-override +AM_CXXFLAGS = -Wall -W -Wcast-align + +# jhrg 3/1/26 -Wno-inconsistent-missing-override if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align diff --git a/tests/D4TestFunction.h b/tests/D4TestFunction.h index 26cb81e30..70088ed23 100644 --- a/tests/D4TestFunction.h +++ b/tests/D4TestFunction.h @@ -56,7 +56,7 @@ class D4TestFunction : public ServerFunction { setFunction(function_scale_dap4); } - virtual ~D4TestFunction() {} + ~D4TestFunction() override {} }; } // namespace libdap diff --git a/tests/D4TestTypeFactory.h b/tests/D4TestTypeFactory.h index c1ab0457c..fdf661f12 100644 --- a/tests/D4TestTypeFactory.h +++ b/tests/D4TestTypeFactory.h @@ -37,45 +37,45 @@ using namespace libdap; class D4TestTypeFactory : public D4BaseTypeFactory { public: D4TestTypeFactory() {} - virtual ~D4TestTypeFactory() {} + ~D4TestTypeFactory() override {} - virtual BaseTypeFactory *ptr_duplicate() const { return new D4TestTypeFactory; } + BaseTypeFactory *ptr_duplicate() const override { return new D4TestTypeFactory; } - virtual BaseType *NewVariable(Type t, const string &name) const; + BaseType *NewVariable(Type t, const string &name) const override; - virtual Byte *NewByte(const string &n = "") const; + Byte *NewByte(const string &n = "") const override; // New for DAP4 - virtual Int8 *NewInt8(const string &n = "") const; - virtual Byte *NewUInt8(const string &n = "") const; - virtual Byte *NewChar(const string &n = "") const; + Int8 *NewInt8(const string &n = "") const override; + Byte *NewUInt8(const string &n = "") const override; + Byte *NewChar(const string &n = "") const override; - virtual Int16 *NewInt16(const string &n = "") const; - virtual UInt16 *NewUInt16(const string &n = "") const; - virtual Int32 *NewInt32(const string &n = "") const; - virtual UInt32 *NewUInt32(const string &n = "") const; + Int16 *NewInt16(const string &n = "") const override; + UInt16 *NewUInt16(const string &n = "") const override; + Int32 *NewInt32(const string &n = "") const override; + UInt32 *NewUInt32(const string &n = "") const override; // New for DAP4 - virtual Int64 *NewInt64(const string &n = "") const; - virtual UInt64 *NewUInt64(const string &n = "") const; + Int64 *NewInt64(const string &n = "") const override; + UInt64 *NewUInt64(const string &n = "") const override; - virtual Float32 *NewFloat32(const string &n = "") const; - virtual Float64 *NewFloat64(const string &n = "") const; + Float32 *NewFloat32(const string &n = "") const override; + Float64 *NewFloat64(const string &n = "") const override; - virtual D4Enum *NewEnum(const string &n = "", Type type = dods_null_c) const; + D4Enum *NewEnum(const string &n = "", Type type = dods_null_c) const override; - virtual Str *NewStr(const string &n = "") const; - virtual Url *NewUrl(const string &n = "") const; - virtual Url *NewURL(const string &n = "") const; + Str *NewStr(const string &n = "") const override; + Url *NewUrl(const string &n = "") const override; + Url *NewURL(const string &n = "") const override; - virtual D4Opaque *NewOpaque(const string &n = "") const; + D4Opaque *NewOpaque(const string &n = "") const override; - virtual Array *NewArray(const string &n = "", BaseType *v = 0) const; + Array *NewArray(const string &n = "", BaseType *v = 0) const override; - virtual Structure *NewStructure(const string &n = "") const; - virtual D4Sequence *NewD4Sequence(const string &n = "") const; + Structure *NewStructure(const string &n = "") const override; + D4Sequence *NewD4Sequence(const string &n = "") const override; - virtual D4Group *NewGroup(const string &n = "") const; + D4Group *NewGroup(const string &n = "") const override; }; #endif // d4_test_type_factory_h diff --git a/tests/Makefile.am b/tests/Makefile.am index 57d4920a1..164b0acfc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,7 +6,9 @@ AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU -I$(top_srcdir)/d4_ce \ -I$(top_srcdir)/d4_function -I$(top_srcdir)/http_dap $(XML2_CFLAGS) \ $(CURL_CFLAGS) $(TIRPC_CFLAGS) -AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-inconsistent-missing-override +AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align + +# jhrg 3/1/26 -Wno-inconsistent-missing-override CXXFLAGS_DEBUG = -g3 -O0 diff --git a/tests/TestArray.h b/tests/TestArray.h index 9f80d9696..aee1725c3 100644 --- a/tests/TestArray.h +++ b/tests/TestArray.h @@ -62,18 +62,18 @@ class TestArray : public Array, public TestCommon { TestArray(const string &n, const string &d, BaseType *v, bool is_dap4 = false); TestArray(const TestArray &rhs); - virtual ~TestArray(); + ~TestArray() override; TestArray &operator=(const TestArray &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } }; #endif // _testarray_h diff --git a/tests/TestByte.h b/tests/TestByte.h index f8f71f973..94c252bdd 100644 --- a/tests/TestByte.h +++ b/tests/TestByte.h @@ -61,18 +61,18 @@ class TestByte : public Byte, public TestCommon { TestByte(const string &n, const string &d); TestByte(const TestByte &rhs); - virtual ~TestByte() {} + ~TestByte() override {} TestByte &operator=(const TestByte &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - virtual void set_series_values(bool sv) { d_series_values = sv; } - virtual bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testbyte_h diff --git a/tests/TestD4Enum.h b/tests/TestD4Enum.h index f1adb2941..c0a92e050 100644 --- a/tests/TestD4Enum.h +++ b/tests/TestD4Enum.h @@ -40,18 +40,18 @@ class TestD4Enum : public D4Enum, public TestCommon { TestD4Enum(const string &n, const string &d, Type t); TestD4Enum(const TestD4Enum &rhs); - virtual ~TestD4Enum() {} + ~TestD4Enum() override {} TestD4Enum &operator=(const TestD4Enum &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - virtual void set_series_values(bool sv) { d_series_values = sv; } - virtual bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testd4enum_h diff --git a/tests/TestD4Group.h b/tests/TestD4Group.h index a0eece396..c3321d5f9 100644 --- a/tests/TestD4Group.h +++ b/tests/TestD4Group.h @@ -40,18 +40,18 @@ class TestD4Group : public D4Group, public TestCommon { TestD4Group(const string &n, const string &d); TestD4Group(const TestD4Group &rhs); - virtual ~TestD4Group(); + ~TestD4Group() override; TestD4Group &operator=(const TestD4Group &rhs); - virtual TestD4Group *ptr_duplicate(); + TestD4Group *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } }; #endif // _test_d4_group_h diff --git a/tests/TestD4Opaque.h b/tests/TestD4Opaque.h index a0ac29b12..1a20c6261 100644 --- a/tests/TestD4Opaque.h +++ b/tests/TestD4Opaque.h @@ -42,18 +42,18 @@ class TestD4Opaque : public D4Opaque, public TestCommon { TestD4Opaque(const string &n, const string &d); TestD4Opaque(const TestD4Opaque &rhs); - virtual ~TestD4Opaque() {} + ~TestD4Opaque() override {} TestD4Opaque &operator=(const TestD4Opaque &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - virtual void set_series_values(bool sv) { d_series_values = sv; } - virtual bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testd4opaque_h diff --git a/tests/TestD4Sequence.h b/tests/TestD4Sequence.h index de76daa35..c5a73d95e 100644 --- a/tests/TestD4Sequence.h +++ b/tests/TestD4Sequence.h @@ -44,20 +44,20 @@ class TestD4Sequence : public D4Sequence, public TestCommon { TestD4Sequence(const string &n, const string &d); TestD4Sequence(const TestD4Sequence &rhs); - virtual ~TestD4Sequence(); + ~TestD4Sequence() override; TestD4Sequence &operator=(const TestD4Sequence &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } - void set_length(int64_t len) { d_len = len; } - virtual int length() const { return (int)d_len; } + void set_length(int64_t len) override { d_len = len; } + int length() const override { return (int)d_len; } }; #endif // _testsequence_h diff --git a/tests/TestFloat32.h b/tests/TestFloat32.h index 1b82a1817..c428c7b5a 100644 --- a/tests/TestFloat32.h +++ b/tests/TestFloat32.h @@ -51,18 +51,18 @@ class TestFloat32 : public Float32, public TestCommon { TestFloat32(const string &n, const string &d); TestFloat32(const TestFloat32 &rhs); - virtual ~TestFloat32() {} + ~TestFloat32() override {} TestFloat32 &operator=(const TestFloat32 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testfloat32_h diff --git a/tests/TestFloat64.h b/tests/TestFloat64.h index 9c8c533d6..0b21f8d20 100644 --- a/tests/TestFloat64.h +++ b/tests/TestFloat64.h @@ -50,18 +50,18 @@ class TestFloat64 : public Float64, public TestCommon { TestFloat64(const string &n, const string &d); TestFloat64(const TestFloat64 &rhs); - virtual ~TestFloat64() {} + ~TestFloat64() override {} TestFloat64 &operator=(const TestFloat64 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testfloat64_h diff --git a/tests/TestFunction.h b/tests/TestFunction.h index 01a9b982c..b75185d08 100644 --- a/tests/TestFunction.h +++ b/tests/TestFunction.h @@ -51,7 +51,7 @@ class TestFunction : public libdap::ServerFunction { setFunction(libdap::function_scale); setVersion("1.0"); } - virtual ~TestFunction() {} + ~TestFunction() override {} }; } // namespace libdap diff --git a/tests/TestGrid.h b/tests/TestGrid.h index 124ece89f..31454581e 100644 --- a/tests/TestGrid.h +++ b/tests/TestGrid.h @@ -50,18 +50,18 @@ class TestGrid : public Grid, public TestCommon { TestGrid(const string &n, const string &d); TestGrid(const TestGrid &rhs); - virtual ~TestGrid(); + ~TestGrid() override; TestGrid &operator=(const TestGrid &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } }; #endif // _testgrid_h diff --git a/tests/TestInt16.h b/tests/TestInt16.h index d4737f97e..951baefad 100644 --- a/tests/TestInt16.h +++ b/tests/TestInt16.h @@ -50,18 +50,18 @@ class TestInt16 : public Int16, public TestCommon { TestInt16(const string &n, const string &d); TestInt16(const TestInt16 &rhs); - virtual ~TestInt16() {} + ~TestInt16() override {} TestInt16 &operator=(const TestInt16 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testint16_h diff --git a/tests/TestInt32.h b/tests/TestInt32.h index 355bf798d..b13c73b4d 100644 --- a/tests/TestInt32.h +++ b/tests/TestInt32.h @@ -50,18 +50,18 @@ class TestInt32 : public Int32, public TestCommon { TestInt32(const string &n, const string &d); TestInt32(const TestInt32 &rhs); - virtual ~TestInt32() {} + ~TestInt32() override {} TestInt32 &operator=(const TestInt32 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - virtual void set_series_values(bool sv) { d_series_values = sv; } - virtual bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testint32_h diff --git a/tests/TestInt64.h b/tests/TestInt64.h index ca888d541..50b8299fe 100644 --- a/tests/TestInt64.h +++ b/tests/TestInt64.h @@ -40,18 +40,18 @@ class TestInt64 : public Int64, public TestCommon { TestInt64(const string &n, const string &d); TestInt64(const TestInt64 &rhs); - virtual ~TestInt64() {} + ~TestInt64() override {} TestInt64 &operator=(const TestInt64 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - virtual void set_series_values(bool sv) { d_series_values = sv; } - virtual bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testint64_h diff --git a/tests/TestInt8.h b/tests/TestInt8.h index a98ccc292..37296689d 100644 --- a/tests/TestInt8.h +++ b/tests/TestInt8.h @@ -40,18 +40,18 @@ class TestInt8 : public Int8, public TestCommon { TestInt8(const string &n, const string &d); TestInt8(const TestInt8 &rhs); - virtual ~TestInt8() {} + ~TestInt8() override {} TestInt8 &operator=(const TestInt8 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testint8_h diff --git a/tests/TestSequence.h b/tests/TestSequence.h index 650f841ea..ff9cdc874 100644 --- a/tests/TestSequence.h +++ b/tests/TestSequence.h @@ -59,20 +59,20 @@ class TestSequence : public Sequence, public TestCommon { TestSequence(const string &n, const string &d); TestSequence(const TestSequence &rhs); - virtual ~TestSequence(); + ~TestSequence() override; TestSequence &operator=(const TestSequence &rhs); - virtual BaseType *ptr_duplicate(); - virtual void transform_to_dap4(libdap::D4Group *root, libdap::Constructor *container); + BaseType *ptr_duplicate() override; + void transform_to_dap4(libdap::D4Group *root, libdap::Constructor *container) override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } - virtual int length() const; + int length() const override; }; #endif // _testsequence_h diff --git a/tests/TestStr.h b/tests/TestStr.h index e7e29d860..41b6d3ac1 100644 --- a/tests/TestStr.h +++ b/tests/TestStr.h @@ -54,18 +54,18 @@ class TestStr : public Str, public TestCommon { TestStr(const string &n, const string &d); TestStr(const TestStr &rhs); - virtual ~TestStr() {} + ~TestStr() override {} TestStr &operator=(const TestStr &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_teststr_h diff --git a/tests/TestStructure.h b/tests/TestStructure.h index 2de870172..992254eb7 100644 --- a/tests/TestStructure.h +++ b/tests/TestStructure.h @@ -55,19 +55,19 @@ class TestStructure : public Structure, public TestCommon { TestStructure(const string &n, const string &d); TestStructure(const TestStructure &rhs); - virtual ~TestStructure(); + ~TestStructure() override; TestStructure &operator=(const TestStructure &rhs); - virtual BaseType *ptr_duplicate(); - virtual void transform_to_dap4(libdap::D4Group *root, libdap::Constructor *container); + BaseType *ptr_duplicate() override; + void transform_to_dap4(libdap::D4Group *root, libdap::Constructor *container) override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool); - bool get_series_values() { return d_series_values; } + void set_series_values(bool) override; + bool get_series_values() override { return d_series_values; } }; #endif // _teststructure_h diff --git a/tests/TestTypeFactory.h b/tests/TestTypeFactory.h index dfa69f288..63b7cb1c0 100644 --- a/tests/TestTypeFactory.h +++ b/tests/TestTypeFactory.h @@ -51,23 +51,23 @@ using namespace libdap; class TestTypeFactory : public BaseTypeFactory { public: TestTypeFactory() {} - virtual ~TestTypeFactory() {} + ~TestTypeFactory() override {} - virtual Byte *NewByte(const string &n = "") const; - virtual Int16 *NewInt16(const string &n = "") const; - virtual UInt16 *NewUInt16(const string &n = "") const; - virtual Int32 *NewInt32(const string &n = "") const; - virtual UInt32 *NewUInt32(const string &n = "") const; - virtual Float32 *NewFloat32(const string &n = "") const; - virtual Float64 *NewFloat64(const string &n = "") const; + Byte *NewByte(const string &n = "") const override; + Int16 *NewInt16(const string &n = "") const override; + UInt16 *NewUInt16(const string &n = "") const override; + Int32 *NewInt32(const string &n = "") const override; + UInt32 *NewUInt32(const string &n = "") const override; + Float32 *NewFloat32(const string &n = "") const override; + Float64 *NewFloat64(const string &n = "") const override; - virtual Str *NewStr(const string &n = "") const; - virtual Url *NewUrl(const string &n = "") const; + Str *NewStr(const string &n = "") const override; + Url *NewUrl(const string &n = "") const override; - virtual Array *NewArray(const string &n = "", BaseType *v = 0) const; - virtual Structure *NewStructure(const string &n = "") const; - virtual Sequence *NewSequence(const string &n = "") const; - virtual Grid *NewGrid(const string &n = "") const; + Array *NewArray(const string &n = "", BaseType *v = 0) const override; + Structure *NewStructure(const string &n = "") const override; + Sequence *NewSequence(const string &n = "") const override; + Grid *NewGrid(const string &n = "") const override; }; #endif // test_type_factory_h diff --git a/tests/TestUInt16.h b/tests/TestUInt16.h index 0853a0edb..bf94ebb88 100644 --- a/tests/TestUInt16.h +++ b/tests/TestUInt16.h @@ -50,18 +50,18 @@ class TestUInt16 : public UInt16, public TestCommon { TestUInt16(const string &n, const string &d); TestUInt16(const TestUInt16 &rhs); - virtual ~TestUInt16() {} + ~TestUInt16() override {} TestUInt16 &operator=(const TestUInt16 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint16_h diff --git a/tests/TestUInt32.h b/tests/TestUInt32.h index c12defcb5..a428b0fed 100644 --- a/tests/TestUInt32.h +++ b/tests/TestUInt32.h @@ -50,18 +50,18 @@ class TestUInt32 : public UInt32, public TestCommon { TestUInt32(const string &n, const string &d); TestUInt32(const TestUInt32 &rhs); - virtual ~TestUInt32() {} + ~TestUInt32() override {} TestUInt32 &operator=(const TestUInt32 &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint32_h diff --git a/tests/TestUInt64.h b/tests/TestUInt64.h index 0a501ce45..cb23aa86a 100644 --- a/tests/TestUInt64.h +++ b/tests/TestUInt64.h @@ -42,18 +42,18 @@ class TestUInt64 : public libdap::UInt64, public TestCommon { TestUInt64(const std::string &n, const std::string &d); TestUInt64(const TestUInt64 &rhs); - virtual ~TestUInt64() {} + ~TestUInt64() override {} TestUInt64 &operator=(const TestUInt64 &rhs); - virtual libdap::BaseType *ptr_duplicate(); + libdap::BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint64_h diff --git a/tests/TestUrl.h b/tests/TestUrl.h index 36b762c9f..5763b6ecf 100644 --- a/tests/TestUrl.h +++ b/tests/TestUrl.h @@ -50,18 +50,18 @@ class TestUrl : public Url, public TestCommon { TestUrl(const string &n, const string &d); TestUrl(const TestUrl &rhs); - virtual ~TestUrl() {} + ~TestUrl() override {} TestUrl &operator=(const TestUrl &rhs); - virtual BaseType *ptr_duplicate(); + BaseType *ptr_duplicate() override; - virtual bool read(); + bool read() override; - virtual void output_values(std::ostream &out); + void output_values(std::ostream &out) override; - void set_series_values(bool sv) { d_series_values = sv; } - bool get_series_values() { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testurl_h diff --git a/unit-tests/Makefile.am b/unit-tests/Makefile.am index f148258a4..7424207c2 100644 --- a/unit-tests/Makefile.am +++ b/unit-tests/Makefile.am @@ -13,7 +13,9 @@ AM_LDADD = $(XML2_LIBS) AM_CXXFLAGS = $(CXX_STD_FLAG) if COMPILER_IS_GCC -AM_CXXFLAGS += -Wall -W -Wcast-align -Wno-self-assign-overloaded +AM_CXXFLAGS += -Wall -W -Wcast-align + +# jhrg 3/1/26 -Wno-self-assign-overloaded endif if CPPUNIT From f60ce35ff26d097f9b07f2e9965e3f16f0bc4c7a Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sun, 1 Mar 2026 21:17:44 -0700 Subject: [PATCH 2/5] Fixed self-assignment tests and suppressed warnings --- unit-tests/ByteTest.cc | 16 ++++++++++++++-- unit-tests/Float32Test.cc | 17 +++++++++++++++-- unit-tests/Float64Test.cc | 17 +++++++++++++++-- unit-tests/Int16Test.cc | 17 +++++++++++++++-- unit-tests/Int32Test.cc | 17 +++++++++++++++-- unit-tests/Int64Test.cc | 17 +++++++++++++++-- unit-tests/Int8Test.cc | 17 +++++++++++++++-- unit-tests/UInt16Test.cc | 17 +++++++++++++++-- unit-tests/UInt32Test.cc | 17 +++++++++++++++-- unit-tests/UInt64Test.cc | 17 +++++++++++++++-- 10 files changed, 149 insertions(+), 20 deletions(-) diff --git a/unit-tests/ByteTest.cc b/unit-tests/ByteTest.cc index b08993e12..1c3c8d6a6 100644 --- a/unit-tests/ByteTest.cc +++ b/unit-tests/ByteTest.cc @@ -99,7 +99,7 @@ class ByteTest : public TestFixture { CPPUNIT_TEST_SUITE(ByteTest); CPPUNIT_TEST(cons_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(checksum_test); CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); @@ -124,14 +124,26 @@ class ByteTest : public TestFixture { CPPUNIT_ASSERT(tb2->value() == 0); } - void equals_test() { + void assignment_tests() { Byte b3 = Byte("a", "b"); Byte b4 = Byte("e"); CPPUNIT_ASSERT(b3.set_value(42) && b3.value() == 42); b4 = b3; CPPUNIT_ASSERT(b3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif b4 = b4; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif CPPUNIT_ASSERT(b4.value() == 42); } diff --git a/unit-tests/Float32Test.cc b/unit-tests/Float32Test.cc index c862c94e6..efa08a79b 100644 --- a/unit-tests/Float32Test.cc +++ b/unit-tests/Float32Test.cc @@ -100,7 +100,7 @@ class Float32Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class Float32Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Float32 i3 = Float32("a", "b"); Float32 i4 = Float32("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/Float64Test.cc b/unit-tests/Float64Test.cc index bc4a5b400..e0364a982 100644 --- a/unit-tests/Float64Test.cc +++ b/unit-tests/Float64Test.cc @@ -100,7 +100,7 @@ class Float64Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class Float64Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Float64 i3 = Float64("a", "b"); Float64 i4 = Float64("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/Int16Test.cc b/unit-tests/Int16Test.cc index 075f3fe02..fd048990f 100644 --- a/unit-tests/Int16Test.cc +++ b/unit-tests/Int16Test.cc @@ -100,7 +100,7 @@ class Int16Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class Int16Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Int16 i3 = Int16("a", "b"); Int16 i4 = Int16("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/Int32Test.cc b/unit-tests/Int32Test.cc index 177cc987b..511b3ca6d 100644 --- a/unit-tests/Int32Test.cc +++ b/unit-tests/Int32Test.cc @@ -100,7 +100,7 @@ class Int32Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class Int32Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Int32 i3 = Int32("a", "b"); Int32 i4 = Int32("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/Int64Test.cc b/unit-tests/Int64Test.cc index 82198f76e..2312bec09 100644 --- a/unit-tests/Int64Test.cc +++ b/unit-tests/Int64Test.cc @@ -100,7 +100,7 @@ class Int64Test : public TestFixture { // CPPUNIT_TEST(val2buf_test); // CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class Int64Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Int64 i3 = Int64("a", "b"); Int64 i4 = Int64("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/Int8Test.cc b/unit-tests/Int8Test.cc index 3613f530d..1019e0fb4 100644 --- a/unit-tests/Int8Test.cc +++ b/unit-tests/Int8Test.cc @@ -100,7 +100,7 @@ class Int8Test : public TestFixture { // CPPUNIT_TEST(val2buf_test); // CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -141,13 +141,26 @@ class Int8Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { Int8 i3 = Int8("a", "b"); Int8 i4 = Int8("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/UInt16Test.cc b/unit-tests/UInt16Test.cc index 9441dc332..243444f82 100644 --- a/unit-tests/UInt16Test.cc +++ b/unit-tests/UInt16Test.cc @@ -100,7 +100,7 @@ class UInt16Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class UInt16Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { UInt16 i3 = UInt16("a", "b"); UInt16 i4 = UInt16("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/UInt32Test.cc b/unit-tests/UInt32Test.cc index 859bd3742..bcd9d64fc 100644 --- a/unit-tests/UInt32Test.cc +++ b/unit-tests/UInt32Test.cc @@ -100,7 +100,7 @@ class UInt32Test : public TestFixture { CPPUNIT_TEST(val2buf_test); CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -140,13 +140,26 @@ class UInt32Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { UInt32 i3 = UInt32("a", "b"); UInt32 i4 = UInt32("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { diff --git a/unit-tests/UInt64Test.cc b/unit-tests/UInt64Test.cc index eb698b247..143fdca32 100644 --- a/unit-tests/UInt64Test.cc +++ b/unit-tests/UInt64Test.cc @@ -92,7 +92,7 @@ class UInt64Test : public TestFixture { // CPPUNIT_TEST(val2buf_test); // CPPUNIT_TEST(buf2val_test); CPPUNIT_TEST(set_value_test); - CPPUNIT_TEST(equals_test); + CPPUNIT_TEST(assignment_tests); CPPUNIT_TEST(type_compare_test); CPPUNIT_TEST(ops_exception_1_test); CPPUNIT_TEST(ops_exception_2_test); @@ -133,13 +133,26 @@ class UInt64Test : public TestFixture { void set_value_test() { CPPUNIT_ASSERT(i2->set_value(42) && i2->value() == 42); } - void equals_test() { + void assignment_tests() { UInt64 i3 = UInt64("a", "b"); UInt64 i4 = UInt64("e"); CPPUNIT_ASSERT(i4.set_value(42) && i4.value() == 42); i3 = i4; CPPUNIT_ASSERT(i3.value() == 42); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif i3 = i3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + CPPUNIT_ASSERT(i3.value() == 42); } void type_compare_test() { From 694264eb8f77e91a2ee527b6fd222c70166d1f16 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sun, 1 Mar 2026 21:21:36 -0700 Subject: [PATCH 3/5] Fixed remainig self-assignment tests and suppressed warnings --- unit-tests/ArrayTest.cc | 12 ++++++++++++ unit-tests/ErrorTest.cc | 12 ++++++++++++ unit-tests/ddsT.cc | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/unit-tests/ArrayTest.cc b/unit-tests/ArrayTest.cc index acedb8c00..925a991df 100644 --- a/unit-tests/ArrayTest.cc +++ b/unit-tests/ArrayTest.cc @@ -205,7 +205,19 @@ class ArrayTest : public TestFixture { // Self-assignment; are objects changed by the assignment? Array a1 = Array("a", d_int16); Array *before = &a1; +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif a1 = a1; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif Array *after = &a1; CPPUNIT_ASSERT_MESSAGE("The pointers should be the same", before == after); } diff --git a/unit-tests/ErrorTest.cc b/unit-tests/ErrorTest.cc index e75bc4ff7..96aef6a67 100644 --- a/unit-tests/ErrorTest.cc +++ b/unit-tests/ErrorTest.cc @@ -167,7 +167,19 @@ void ErrorTest::test_assignment_self() { int line = 2345; Error error(code, message, file, line); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif error = error; // Self-assignment +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif CPPUNIT_ASSERT_EQUAL(code, error.get_error_code()); CPPUNIT_ASSERT_EQUAL(message, error.get_error_message()); CPPUNIT_ASSERT_EQUAL(file, error.get_file()); diff --git a/unit-tests/ddsT.cc b/unit-tests/ddsT.cc index dab433f93..b124b06bd 100644 --- a/unit-tests/ddsT.cc +++ b/unit-tests/ddsT.cc @@ -191,7 +191,19 @@ class ddsT : public CppUnit::TestFixture { DDS dds3(factory, "TestDDS3"); dds3 = dds2; CPPUNIT_ASSERT(dds3.num_var() == 8); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-overloaded" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wself-assign" +#endif dds3 = dds3; +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif CPPUNIT_ASSERT(dds3.num_var() == 8); int nv = dds.num_var(); From ee8626032cca1f24676210c800412a9e17e987b4 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sun, 1 Mar 2026 21:35:23 -0700 Subject: [PATCH 4/5] indentation --- Makefile.am | 2 +- tests/TestArray.h | 2 +- tests/TestByte.h | 4 ++-- tests/TestD4Enum.h | 4 ++-- tests/TestD4Group.h | 2 +- tests/TestD4Opaque.h | 4 ++-- tests/TestD4Sequence.h | 4 ++-- tests/TestFloat32.h | 4 ++-- tests/TestFloat64.h | 4 ++-- tests/TestGrid.h | 2 +- tests/TestInt16.h | 4 ++-- tests/TestInt32.h | 4 ++-- tests/TestInt64.h | 4 ++-- tests/TestInt8.h | 4 ++-- tests/TestSequence.h | 2 +- tests/TestStr.h | 4 ++-- tests/TestStructure.h | 2 +- tests/TestUInt16.h | 4 ++-- tests/TestUInt32.h | 4 ++-- tests/TestUInt64.h | 4 ++-- tests/TestUrl.h | 4 ++-- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile.am b/Makefile.am index c9c64e5dc..5a49bdeef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ aclocaldir=$(datadir)/aclocal pkgconfigdir=$(libdir)/pkgconfig AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl -I$(top_srcdir)/GNU -I$(top_srcdir)/http_dap $(XML2_CFLAGS) $(TIRPC_CFLAGS) -AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-deprecated-register +AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-deprecated-register # jhrg 3/1/26 -Wno-inconsistent-missing-override diff --git a/tests/TestArray.h b/tests/TestArray.h index aee1725c3..f4ec74910 100644 --- a/tests/TestArray.h +++ b/tests/TestArray.h @@ -73,7 +73,7 @@ class TestArray : public Array, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } }; #endif // _testarray_h diff --git a/tests/TestByte.h b/tests/TestByte.h index 94c252bdd..9dd8aaa86 100644 --- a/tests/TestByte.h +++ b/tests/TestByte.h @@ -71,8 +71,8 @@ class TestByte : public Byte, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testbyte_h diff --git a/tests/TestD4Enum.h b/tests/TestD4Enum.h index c0a92e050..d6d1677f7 100644 --- a/tests/TestD4Enum.h +++ b/tests/TestD4Enum.h @@ -50,8 +50,8 @@ class TestD4Enum : public D4Enum, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testd4enum_h diff --git a/tests/TestD4Group.h b/tests/TestD4Group.h index c3321d5f9..f401c60a7 100644 --- a/tests/TestD4Group.h +++ b/tests/TestD4Group.h @@ -51,7 +51,7 @@ class TestD4Group : public D4Group, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } }; #endif // _test_d4_group_h diff --git a/tests/TestD4Opaque.h b/tests/TestD4Opaque.h index 1a20c6261..16e7fb10c 100644 --- a/tests/TestD4Opaque.h +++ b/tests/TestD4Opaque.h @@ -52,8 +52,8 @@ class TestD4Opaque : public D4Opaque, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testd4opaque_h diff --git a/tests/TestD4Sequence.h b/tests/TestD4Sequence.h index c5a73d95e..514289060 100644 --- a/tests/TestD4Sequence.h +++ b/tests/TestD4Sequence.h @@ -54,9 +54,9 @@ class TestD4Sequence : public D4Sequence, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } - void set_length(int64_t len) override { d_len = len; } + void set_length(int64_t len) override { d_len = len; } int length() const override { return (int)d_len; } }; diff --git a/tests/TestFloat32.h b/tests/TestFloat32.h index c428c7b5a..62a594de8 100644 --- a/tests/TestFloat32.h +++ b/tests/TestFloat32.h @@ -61,8 +61,8 @@ class TestFloat32 : public Float32, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testfloat32_h diff --git a/tests/TestFloat64.h b/tests/TestFloat64.h index 0b21f8d20..bf69e88ba 100644 --- a/tests/TestFloat64.h +++ b/tests/TestFloat64.h @@ -60,8 +60,8 @@ class TestFloat64 : public Float64, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testfloat64_h diff --git a/tests/TestGrid.h b/tests/TestGrid.h index 31454581e..5c4e7e0a7 100644 --- a/tests/TestGrid.h +++ b/tests/TestGrid.h @@ -61,7 +61,7 @@ class TestGrid : public Grid, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } }; #endif // _testgrid_h diff --git a/tests/TestInt16.h b/tests/TestInt16.h index 951baefad..e6477c0d0 100644 --- a/tests/TestInt16.h +++ b/tests/TestInt16.h @@ -60,8 +60,8 @@ class TestInt16 : public Int16, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testint16_h diff --git a/tests/TestInt32.h b/tests/TestInt32.h index b13c73b4d..cb0281dfc 100644 --- a/tests/TestInt32.h +++ b/tests/TestInt32.h @@ -60,8 +60,8 @@ class TestInt32 : public Int32, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testint32_h diff --git a/tests/TestInt64.h b/tests/TestInt64.h index 50b8299fe..01f02f515 100644 --- a/tests/TestInt64.h +++ b/tests/TestInt64.h @@ -50,8 +50,8 @@ class TestInt64 : public Int64, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_testint64_h diff --git a/tests/TestInt8.h b/tests/TestInt8.h index 37296689d..0dc92b169 100644 --- a/tests/TestInt8.h +++ b/tests/TestInt8.h @@ -50,8 +50,8 @@ class TestInt8 : public Int8, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testint8_h diff --git a/tests/TestSequence.h b/tests/TestSequence.h index ff9cdc874..65ec8934a 100644 --- a/tests/TestSequence.h +++ b/tests/TestSequence.h @@ -70,7 +70,7 @@ class TestSequence : public Sequence, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } int length() const override; }; diff --git a/tests/TestStr.h b/tests/TestStr.h index 41b6d3ac1..d554e0bf3 100644 --- a/tests/TestStr.h +++ b/tests/TestStr.h @@ -64,8 +64,8 @@ class TestStr : public Str, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif //_teststr_h diff --git a/tests/TestStructure.h b/tests/TestStructure.h index 992254eb7..4f66bfc35 100644 --- a/tests/TestStructure.h +++ b/tests/TestStructure.h @@ -67,7 +67,7 @@ class TestStructure : public Structure, public TestCommon { void output_values(std::ostream &out) override; void set_series_values(bool) override; - bool get_series_values() override { return d_series_values; } + bool get_series_values() override { return d_series_values; } }; #endif // _teststructure_h diff --git a/tests/TestUInt16.h b/tests/TestUInt16.h index bf94ebb88..37cc37074 100644 --- a/tests/TestUInt16.h +++ b/tests/TestUInt16.h @@ -60,8 +60,8 @@ class TestUInt16 : public UInt16, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint16_h diff --git a/tests/TestUInt32.h b/tests/TestUInt32.h index a428b0fed..a947e0b0c 100644 --- a/tests/TestUInt32.h +++ b/tests/TestUInt32.h @@ -60,8 +60,8 @@ class TestUInt32 : public UInt32, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint32_h diff --git a/tests/TestUInt64.h b/tests/TestUInt64.h index cb23aa86a..1a058210b 100644 --- a/tests/TestUInt64.h +++ b/tests/TestUInt64.h @@ -52,8 +52,8 @@ class TestUInt64 : public libdap::UInt64, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testuint64_h diff --git a/tests/TestUrl.h b/tests/TestUrl.h index 5763b6ecf..f90b2855d 100644 --- a/tests/TestUrl.h +++ b/tests/TestUrl.h @@ -60,8 +60,8 @@ class TestUrl : public Url, public TestCommon { void output_values(std::ostream &out) override; - void set_series_values(bool sv) override { d_series_values = sv; } - bool get_series_values() override { return d_series_values; } + void set_series_values(bool sv) override { d_series_values = sv; } + bool get_series_values() override { return d_series_values; } }; #endif // _testurl_h From c1baf66a64d367ffd0ad4f08c932c4d6c73a6f24 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 2 Mar 2026 10:25:43 -0700 Subject: [PATCH 5/5] Removed -Wno-inconsistent-override-use --- Makefile.am | 2 -- d4_ce/CMakeLists.txt | 2 +- d4_ce/Makefile.am | 2 -- d4_function/CMakeLists.txt | 2 +- d4_function/Makefile.am | 2 -- tests/Makefile.am | 2 -- unit-tests/Makefile.am | 2 -- 7 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index 580cbc104..f60b42249 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,8 +12,6 @@ pkgconfigdir=$(libdir)/pkgconfig AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl -I$(top_srcdir)/GNU -I$(top_srcdir)/http_dap $(XML2_CFLAGS) $(TIRPC_CFLAGS) AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -Wno-deprecated-register -# jhrg 3/1/26 -Wno-inconsistent-missing-override - CXXFLAGS_DEBUG = -g3 -O0 # Build using the Address sanitizer (gcc 4.8+ and clang 3.3+). diff --git a/d4_ce/CMakeLists.txt b/d4_ce/CMakeLists.txt index a24bf579c..42cd25ad9 100644 --- a/d4_ce/CMakeLists.txt +++ b/d4_ce/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Basic CXX flags -set(D4_CE_CXXFLAGS -Wall -Wcast-align -Wno-inconsistent-missing-override) +set(D4_CE_CXXFLAGS -Wall -Wcast-align) if (BUILD_DEVELOPER) list(APPEND D4_CE_CXXFLAGS -g3 -O0) diff --git a/d4_ce/Makefile.am b/d4_ce/Makefile.am index 39f33a41f..0ee2169a2 100644 --- a/d4_ce/Makefile.am +++ b/d4_ce/Makefile.am @@ -12,8 +12,6 @@ SUBDIRS = . unit-tests AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce $(XML2_CFLAGS) $(TIRPC_CFLAGS) AM_CXXFLAGS = -Wall -W -Wcast-align -# jhrg 3/1/26 -Wno-inconsistent-missing-override - if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align endif diff --git a/d4_function/CMakeLists.txt b/d4_function/CMakeLists.txt index c5edf774a..e2bbd2619 100644 --- a/d4_function/CMakeLists.txt +++ b/d4_function/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Basic compilation flags -set(D4_FUNCTION_CXXFLAGS -Wall -Wcast-align -Wno-inconsistent-missing-override) +set(D4_FUNCTION_CXXFLAGS -Wall -Wcast-align) if (BUILD_DEVELOPER) list(APPEND D4_FUNCTION_CXXFLAGS -g3 -O0) diff --git a/d4_function/Makefile.am b/d4_function/Makefile.am index ee3ee3a43..947349412 100644 --- a/d4_function/Makefile.am +++ b/d4_function/Makefile.am @@ -7,8 +7,6 @@ AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce -I$(srcdir) $(XML2_CFLAGS) AM_CXXFLAGS = -Wall -W -Wcast-align -# jhrg 3/1/26 -Wno-inconsistent-missing-override - if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 164b0acfc..6232ddb20 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,8 +8,6 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU -I$(top_srcdir)/d4_ce \ $(CURL_CFLAGS) $(TIRPC_CFLAGS) AM_CXXFLAGS = $(CXX_STD_FLAG) -Wall -W -Wcast-align -# jhrg 3/1/26 -Wno-inconsistent-missing-override - CXXFLAGS_DEBUG = -g3 -O0 if USE_ASAN diff --git a/unit-tests/Makefile.am b/unit-tests/Makefile.am index 7424207c2..bd345b9b3 100644 --- a/unit-tests/Makefile.am +++ b/unit-tests/Makefile.am @@ -14,8 +14,6 @@ AM_CXXFLAGS = $(CXX_STD_FLAG) if COMPILER_IS_GCC AM_CXXFLAGS += -Wall -W -Wcast-align - -# jhrg 3/1/26 -Wno-self-assign-overloaded endif if CPPUNIT