GNOME Bugzilla – Bug 356095
Compilation warning in gda-value.h
Last modified: 2006-12-27 16:43:13 UTC
Please describe the problem: On compiling, gda-value.h gives a warning. It prevents compiling software with -Werror that uses GdaValue. Steps to reproduce: 1. Create a piece of software that uses GdaValue (including gda-value.h). 2. Compile this software with -Werror Actual results: An error like this: In file included from /usr/include/libgda-1.2/libgda/gda-field.h:27, from /usr/include/libgda-1.2/libgda/gda-row.h:27, from /usr/include/libgda-1.2/libgda/gda-data-model.h:30, from /usr/include/libgda-1.2/libgda/gda-connection.h:28, from /usr/include/libgda-1.2/libgda/gda-client.h:27, from /usr/include/libgda-1.2/libgda/libgda.h:28, from /usr/include/libfisterra-server/f_egb_util.h:27, from f_dao_replication_module.h:31, from f_dao_replication_module.c:25: /usr/include/libgda-1.2/libgda/gda-value.h:183: warning: type qualifiers ignored on function return type Expected results: No warning Does this happen every time? Yes, if you use gcc 4.x Other information: The problem is with the use of const in a non-pointer type: G_CONST_RETURN gpointer gda_value_get_binary (GdaValue *value, glong *size); It's not allowed. The macro should be removed in this function declaration.
Created attachment 72845 [details] [review] Patch to remove the const declaration in gda-value.h This patch drops the warning with gcc 4.x in gda-value.h.
This function now returns a GdaBinary*, so I think the use of const is OK now. Please reopen this bug if I am wrong.