[libgdamm] Fix build with fatal warnings enabled
- From: Daniel Elstner <daniel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgdamm] Fix build with fatal warnings enabled
- Date: Thu, 20 Aug 2009 16:08:11 +0000 (UTC)
commit 092fe2128e4f2d651e19dd0a0673380efbc71497
Author: Daniel Elstner <danielk openismus com>
Date: Thu Aug 20 17:14:10 2009 +0200
Fix build with fatal warnings enabled
* configure.ac (LIBGDAMM_WXXFLAGS): Pass the option
-Wno-missing-field-initializers at warning level max and above,
in order to get the GValue initializations to pass.
* libgda/src/statement.ccg (Statement::to_sql): Remove name of
unused 'params_used' parameter. Extend the FIXME comment to say
that it cannot be fixed since the wrapper prototype is broken.
* libgda/src/sqlparser.hg: Remove the #pragma GCC system_header
directive, which had apparently been put here for the insane
reason to suppress a warning about /* occurring in a /* ... */
comment. Instead, avoid the problem by inserting dummy Doxygen
commands.
* libgda/libgdamm/value.cc (Value::Value): Explicitly call the
inherited Glib::ValueBase default constructor to avoid a warning.
However, the entire thing is conceptually broken beyond belief
anyway.
* examples/{config,simple}/main.cc (main): Remove names of unused
parameters.
ChangeLog | 22 ++++++++++++++++++++++
configure.ac | 2 +-
examples/config/main.cc | 2 +-
examples/simple/main.cc | 2 +-
libgda/libgdamm/value.cc | 6 ++++++
libgda/src/sqlparser.hg | 9 ++-------
libgda/src/statement.ccg | 5 +++--
7 files changed, 36 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0c31c0f..49fff41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
2009-08-20 Daniel Elstner <danielk openismus com>
+ Fix build with fatal warnings enabled
+
+ * configure.ac (LIBGDAMM_WXXFLAGS): Pass the option
+ -Wno-missing-field-initializers at warning level max and above,
+ in order to get the GValue initializations to pass.
+ * libgda/src/statement.ccg (Statement::to_sql): Remove name of
+ unused 'params_used' parameter. Extend the FIXME comment to say
+ that it cannot be fixed since the wrapper prototype is broken.
+ * libgda/src/sqlparser.hg: Remove the #pragma GCC system_header
+ directive, which had apparently been put here for the insane
+ reason to suppress a warning about /* occurring in a /* ... */
+ comment. Instead, avoid the problem by inserting dummy Doxygen
+ commands.
+ * libgda/libgdamm/value.cc (Value::Value): Explicitly call the
+ inherited Glib::ValueBase default constructor to avoid a warning.
+ However, the entire thing is conceptually broken beyond belief
+ anyway.
+ * examples/{config,simple}/main.cc (main): Remove names of unused
+ parameters.
+
+2009-08-20 Daniel Elstner <danielk openismus com>
+
Clean up libgdammconfig.h.in template
* libgda/libgdammconfig.h.in: Copy #undef statements including
diff --git a/configure.ac b/configure.ac
index 11d63d5..b86da95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.4])
AC_LANG([C++])
MM_ARG_ENABLE_WARNINGS([LIBGDAMM_WXXFLAGS],
[-Wall],
- [-pedantic -Wall -Wextra],
+ [-pedantic -Wall -Wextra -Wno-missing-field-initializers],
[G GDA])
MM_ARG_ENABLE_DOCUMENTATION
diff --git a/examples/config/main.cc b/examples/config/main.cc
index 6449e86..39cf6fc 100644
--- a/examples/config/main.cc
+++ b/examples/config/main.cc
@@ -24,7 +24,7 @@
using namespace Gnome;
-int main (int argc, char** argv)
+int main(int, char**)
{
Gda::init();
diff --git a/examples/simple/main.cc b/examples/simple/main.cc
index 71ea3a6..8586a2f 100644
--- a/examples/simple/main.cc
+++ b/examples/simple/main.cc
@@ -170,7 +170,7 @@ void display_meta_store(Glib::RefPtr<Gda::Connection>& cnc)
std::cout << model->dump_as_string() << std::endl;
}
-int main (int argc, char** argv)
+int main (int, char**)
{
Gda::init();
Glib::RefPtr<Gda::Connection> cnc;
diff --git a/libgda/libgdamm/value.cc b/libgda/libgdamm/value.cc
index 2dd77e7..a9e4ada 100644
--- a/libgda/libgdamm/value.cc
+++ b/libgda/libgdamm/value.cc
@@ -197,17 +197,23 @@ bool Value::operator!=(const Value& src) const
Value::Value()
+:
+ Glib::ValueBase()
{
//Creates a null. TODO: Is this really equivalent to gda_value_new_null()?
}
Value::Value(const Value& src)
+:
+ Glib::ValueBase()
{
if(G_IS_VALUE(src.gobj()))
init(src.gobj());
}
Value::Value(const GValue* castitem)
+:
+ Glib::ValueBase()
{
if(G_IS_VALUE(castitem))
init(castitem);
diff --git a/libgda/src/sqlparser.hg b/libgda/src/sqlparser.hg
index aa0a7ca..51be0e7 100644
--- a/libgda/src/sqlparser.hg
+++ b/libgda/src/sqlparser.hg
@@ -34,11 +34,6 @@ namespace Gda
_WRAP_ENUM(SqlParserMode, GdaSqlParserMode)
_WRAP_GERROR(SqlParserError, GdaSqlParserError, GDA_SQL_PARSER_ERROR)
-// This is a hack to avoid a stupid gcc warning for a correctly escaped comment.
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
/** SQL parser.
*
* The Gda::SqlParser is an object dedicated to creating Gda::Statement and
@@ -82,13 +77,13 @@ _WRAP_GERROR(SqlParserError, GdaSqlParserError, GDA_SQL_PARSER_ERROR)
* - ##NAME[::TYPE[::NULL]]: for a variable named NAME with the optional type TYPE
* (which can be a GType name or a custom database type name), and with the
* optional "::NULL" to instruct that the variable can be NULL.
- * - ## //* name:NAME [type:TYPE] [nullok:[TRUE|FALSE]] [descr:DESCR] *\/
+ * - ## //@verbatim endverbatim* name:NAME [type:TYPE] [nullok:[TRUE|FALSE]] [descr:DESCR] * verbatim@endverbatim/
* for a variable named NAME with the optional type TYPE (which can be a GType
* name or a custom database type name), with the optional "nullok" attribute
* and an optional description DESCR. Note that the NAME, TYPE and DESCR literals here
* must be quoted (simple or double quotes) if they include non alphanumeric
* characters, and that there must always be at least a space between the
- * ## and the //* ... *\/.
+ * ## and the //@verbatim endverbatim* ... * verbatim@endverbatim/.
*
* @ingroup Connection
*/
diff --git a/libgda/src/statement.ccg b/libgda/src/statement.ccg
index c992e6d..8a1aa77 100644
--- a/libgda/src/statement.ccg
+++ b/libgda/src/statement.ccg
@@ -101,10 +101,10 @@ Glib::ustring Statement::to_sql(const Glib::RefPtr<Set>& params, std::auto_ptr<G
#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring Statement::to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Set>& params,
- StatementSqlFlag flags, const HolderSList& params_used) const
+ StatementSqlFlag flags, const HolderSList&) const
#else
Glib::ustring Statement::to_sql(const Glib::RefPtr<Connection>& cnc, const Glib::RefPtr<Set>& params,
- StatementSqlFlag flags, const HolderSList& params_used,
+ StatementSqlFlag flags, const HolderSList&,
std::auto_ptr<Glib::Error>& error) const
#endif //GLIBMM_EXCEPTIONS_ENABLED
{
@@ -123,6 +123,7 @@ Glib::ustring Statement::to_sql(const Glib::RefPtr<Connection>& cnc, const Glib:
if (list)
{
// FIXME: Set params_used somehow
+ // Nope, no way. The wrapper prototype is just broken. --danielk
}
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]