[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gwave: building on openSUSE, various comments



Hi Steve,

On Samstag, 7. Februar 2009, Werner Hoch wrote:
> Compiled out of the box, but there are some compiler warnings.
> When building rpms the compiler warnings are treated as errors and
> the buildservice of openSUSE doesn't accept that package. This is
> only true for openSUSE 11.1.
>
> The messages from the buildservice logs are:
> ---------
> I: Program returns random data in a function
> E: gwave2 no-return-in-nonvoid-function cmd.c:739
> E: gwave2 no-return-in-nonvoid-function event.c:226, 206, 186
> E: gwave2 no-return-in-nonvoid-function gtkmisc.c:325
> E: gwave2 no-return-in-nonvoid-function wavelist.c:590
> ---------
>
> The first three errors point to functions defined with SCM_DEFINE.
> They have no return statement in it.
> I don't know what they should return. Maybe adding a "return
> SCM_UNSPECIFIED;" would fix the warning.
>
> The last warning/error in wavelist.c is in the function
> wavelist_button_click. I think the function should not return
> anything and the function definition could be changed to
>   void wavelist_button_click( ..)

I've attached a patch that fixes the warnings.

Regards
Werner
From a494bbb173f833a805a3517199102ecdd3ed1d43 Mon Sep 17 00:00:00 2001
From: Werner Hoch <werner.ho@xxxxxx>
Date: Sun, 8 Feb 2009 08:52:28 +0100
Subject: [PATCH] fix gcc warnings no-return-in-nonvoid-function

Error message from the openSUSE BuildService:
I: Program returns random data in a function
E: gwave2 no-return-in-nonvoid-function cmd.c:739
E: gwave2 no-return-in-nonvoid-function event.c:226, 206, 186
E: gwave2 no-return-in-nonvoid-function gtkmisc.c:325
E: gwave2 no-return-in-nonvoid-function wavelist.c:590
---
 src/cmd.c      |    2 ++
 src/event.c    |    6 ++++++
 src/gtkmisc.c  |    2 ++
 src/wavelist.c |    6 +++---
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/cmd.c b/src/cmd.c
index 2784702..7051471 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -736,6 +736,8 @@ SCM_DEFINE(set_visiblewave_measure_x, "set-visiblewave-measure!", 3, 0, 0,
 		mbtn_set_func(cvw->mbtn[mno], mfunc);
 		mbtn_update(cvw->mbtn[mno], NULL);
 	}
+
+	return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
 
diff --git a/src/event.c b/src/event.c
index d4cb37a..6325917 100644
--- a/src/event.c
+++ b/src/event.c
@@ -183,6 +183,8 @@ SCM_DEFINE(select_range_x, "select-range-x", 1, 0, 0,
 
 	set_all_wp_cursors(GDK_RIGHT_SIDE);
 	wtable->mstate = M_SELRANGE_ARMED;
+
+	return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
 
@@ -203,6 +205,8 @@ SCM_DEFINE(select_range_y, "select-range-y", 1, 0, 0,
 
 	set_all_wp_cursors(GDK_TOP_SIDE);
 	wtable->mstate = M_SELRANGE_ARMED;
+
+	return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
 
@@ -223,6 +227,8 @@ SCM_DEFINE(select_range_xy, "select-range-xy", 1, 0, 0,
 
 	set_all_wp_cursors(GDK_TOP_LEFT_CORNER);
 	wtable->mstate = M_SELRANGE_ARMED;
+
+	return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
 
diff --git a/src/gtkmisc.c b/src/gtkmisc.c
index 5d3430a..b329a3b 100644
--- a/src/gtkmisc.c
+++ b/src/gtkmisc.c
@@ -322,6 +322,8 @@ SCM_DEFINE(gwave_gtk_menu_popup, "gtk-menu-popup", 7, 0, 0,
 	VALIDATE_ARG_INT_COPY(7, activate_time, ctime);
 
 	gtk_menu_popup(cmenu, NULL, NULL, NULL, NULL, cbutton, ctime);
+
+	return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
 #endif /* HAVE_GUILE_GTK_MENU_POPUP */
diff --git a/src/wavelist.c b/src/wavelist.c
index 4f128b5..5cde270 100644
--- a/src/wavelist.c
+++ b/src/wavelist.c
@@ -194,8 +194,8 @@ static GtkWidget *create_wavelist_menu(GWDataFile *wdata);
 void gwfile_add_wv_to_list(gpointer d /*WaveVar* */,
 			   gpointer p /*GWDataFile */);
 
-static gint wavelist_button_click(GtkWidget *widget,
-				  GdkEventButton *event, gpointer data);
+void wavelist_button_click(GtkWidget *widget,
+                           GdkEventButton *event, gpointer data);
 
 XSCM_HOOK(new_wavefile_hook,"new-wavefile-hook", 1, (SCM DF),
 "This hook is invoked when a new waveform file is successfully loaded."
@@ -576,7 +576,7 @@ cmd_show_wave_list(GtkWidget *w, GWDataFile *wdata)
  * Called for all button presses on wavelist button.
  * If it is a doubleclick, add variable to the "current" wavepanel immediately.
  */
-static gint
+void
 wavelist_button_click(GtkWidget *widget, 
 		      GdkEventButton *bevent, 
 		      gpointer data)
-- 
1.6.0.2


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user