summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-04-23 06:12:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-04-23 06:12:20 +0200
commit1e653e1b10f19454cd2dac621fd5bb1f19a7aeac (patch)
treefebff04110a4f5b03275915ce61fe09163c88f4f
parent45e78bf8e308cd5f01ba886dad2a756c3ef90370 (diff)
Suppress bunch of unused/uninitialized warnings
-rw-r--r--libodb-pgsql/odb/pgsql/statement.cxx3
-rw-r--r--libodb-sqlite/odb/sqlite/statement.hxx2
-rw-r--r--libodb/odb/nullable.hxx8
-rw-r--r--libodb/odb/transaction.cxx2
-rw-r--r--odb-tests/common/wrapper/test.hxx2
-rw-r--r--odb/odb/relational/source.cxx2
6 files changed, 14 insertions, 5 deletions
diff --git a/libodb-pgsql/odb/pgsql/statement.cxx b/libodb-pgsql/odb/pgsql/statement.cxx
index 8574c37..03d58cd 100644
--- a/libodb-pgsql/odb/pgsql/statement.cxx
+++ b/libodb-pgsql/odb/pgsql/statement.cxx
@@ -24,6 +24,8 @@
#include <odb/tracer.hxx>
+#include <odb/details/unused.hxx>
+
#include <odb/pgsql/pgsql-oid.hxx>
#include <odb/pgsql/statement.hxx>
#include <odb/pgsql/exceptions.hxx>
@@ -871,6 +873,7 @@ namespace odb
//
{
PGresult* end (PQgetResult (ch));
+ ODB_POTENTIALLY_UNUSED (end);
assert (end == 0);
}
}
diff --git a/libodb-sqlite/odb/sqlite/statement.hxx b/libodb-sqlite/odb/sqlite/statement.hxx
index 9eeea7b..9228103 100644
--- a/libodb-sqlite/odb/sqlite/statement.hxx
+++ b/libodb-sqlite/odb/sqlite/statement.hxx
@@ -14,6 +14,7 @@
#include <cassert>
#include <odb/statement.hxx>
+#include <odb/details/unused.hxx>
#include <odb/sqlite/version.hxx>
#include <odb/sqlite/forward.hxx>
@@ -139,6 +140,7 @@ namespace odb
void
active (bool active)
{
+ ODB_POTENTIALLY_UNUSED (active);
assert (active);
if (!active_)
diff --git a/libodb/odb/nullable.hxx b/libodb/odb/nullable.hxx
index 75f5892..faa55c4 100644
--- a/libodb/odb/nullable.hxx
+++ b/libodb/odb/nullable.hxx
@@ -197,7 +197,7 @@ namespace odb
nullable (const nullable& y)
: null_ (y.null_)
{
- if (!null_)
+ if (!y.null_)
new (&value_) T (y.value_);
}
@@ -206,7 +206,7 @@ namespace odb
nullable (nullable&& y)
: null_ (y.null_)
{
- if (!null_)
+ if (!y.null_)
new (&value_) T (std::move (y.value_));
}
@@ -216,7 +216,7 @@ namespace odb
nullable (const nullable<Y>& y)
: null_ (y.null_)
{
- if (!null_)
+ if (!y.null_)
new (&value_) T (y.value_);
}
@@ -226,7 +226,7 @@ namespace odb
nullable (nullable<Y>&& y)
: null_ (y.null_)
{
- if (!null_)
+ if (!y.null_)
new (&value_) T (std::move (y.value_));
}
diff --git a/libodb/odb/transaction.cxx b/libodb/odb/transaction.cxx
index f75cf32..03810a1 100644
--- a/libodb/odb/transaction.cxx
+++ b/libodb/odb/transaction.cxx
@@ -5,6 +5,7 @@
#include <odb/exceptions.hxx>
#include <odb/details/tls.hxx>
+#include <odb/details/unused.hxx>
using namespace std;
@@ -335,6 +336,7 @@ namespace odb
connection& transaction_impl::
connection (database_type* db)
{
+ ODB_POTENTIALLY_UNUSED (db);
assert (db == 0 || db == &database_);
return *connection_;
}
diff --git a/odb-tests/common/wrapper/test.hxx b/odb-tests/common/wrapper/test.hxx
index 3ae4151..91f5758 100644
--- a/odb-tests/common/wrapper/test.hxx
+++ b/odb-tests/common/wrapper/test.hxx
@@ -60,7 +60,7 @@ namespace test1
#pragma db value
struct comp1
{
- comp1 () {}
+ comp1 (): num (0) {}
comp1 (const std::string& s, int n): str (s), num (n) {}
std::string str;
diff --git a/odb/odb/relational/source.cxx b/odb/odb/relational/source.cxx
index e00626a..abc0a46 100644
--- a/odb/odb/relational/source.cxx
+++ b/odb/odb/relational/source.cxx
@@ -4383,6 +4383,7 @@ traverse_object (type& c)
<< endl;
os << db << "::transaction& tr (" << db << "::transaction::current ());"
+ << "ODB_POTENTIALLY_UNUSED (tr);"
<< endl
<< "// The connection used by the current transaction and the" << endl
<< "// one used to prepare this statement must be the same." << endl
@@ -5683,6 +5684,7 @@ traverse_view (type& c)
<< endl;
os << db << "::transaction& tr (" << db << "::transaction::current ());"
+ << "ODB_POTENTIALLY_UNUSED (tr);"
<< endl
<< "// The connection used by the current transaction and the" << endl
<< "// one used to prepare this statement must be the same." << endl