gEDA-dev: Compile warnings in gschem
Peter Clifton
pcjc2 at cam.ac.uk
Sun Apr 22 08:52:23 EDT 2007
Posting here, rather than in the bug tracker as SourceFore appears to be
down at the moment.
The recent compile warnings identified in gschem are due to gettext
macro expansion when I18N is disabled. It appears to be returning a
(const char *) when the expected return type from gettext is a (char *),
at least according to man 3 gettext.
The following quiets it, but I'm not sure if its correct to just force
the cast back. Any ideas people?
diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index d1fc794..9d5fa59 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -238,7 +238,7 @@ void get_main_menu(TOPLEVEL * w_current, GtkWidget
** menubar)
static gchar* gettext_fn(const gchar *path,
gpointer func_data ATTRIBUTE_UNUSED)
{
- return gettext(path);
+ return (gchar *)gettext(path);
}
GtkWidget *get_main_popup(TOPLEVEL *w_current)
and
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 8bb38b9..721904f 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -3642,7 +3642,7 @@ close_confirmation_dialog_constructor (GType type,
}
/* secondary label */
- str = _("If you don't save, all your changes will be permanently
lost.");
+ str = (gchar *)_("If you don't save, all your changes will be
permanently lost.");
label = GTK_WIDGET (g_object_new (GTK_TYPE_LABEL,
/* GtkMisc */
"xalign", 0.0,
(Or, better perhaps, for the last case)
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 8bb38b9..7912e5b 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -3533,6 +3533,7 @@ close_confirmation_dialog_constructor (GType type,
GtkTreeIter iter;
gboolean ret, single_page;
gchar *tmp, *str;
+ const gchar *const_str;
/* chain up to constructor of parent class */
object =
@@ -3642,7 +3643,7 @@ close_confirmation_dialog_constructor (GType type,
}
/* secondary label */
- str = _("If you don't save, all your changes will be permanently
lost.");
+ const_str = _("If you don't save, all your changes will be
permanently lost.");
label = GTK_WIDGET (g_object_new (GTK_TYPE_LABEL,
/* GtkMisc */
"xalign", 0.0,
@@ -3650,7 +3651,7 @@ close_confirmation_dialog_constructor (GType type,
"selectable", TRUE,
/* GtkLabel */
"wrap", TRUE,
- "label", str,
+ "label", const_str,
NULL));
gtk_box_pack_start (GTK_BOX (vbox), label,
FALSE, FALSE, 0);
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
More information about the geda-dev
mailing list