Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 81683

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: gnome-spellAssignee: Jeremy Katz <katzj>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-12 19:21:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description d.binderman 2003-01-12 18:42:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I just tried to compile package gnome-spell-0.4.1-4 from Redhat 8.0

The compiler said

dictionary.c:204: warning: `return' with no value, in function returning non-void

Here is the source code

        g_return_if_fail (word);

Maybe
        g_return_val_if_fail( word, NULL);

would be better ?

Here is an untested patch

*** ./gnome-spell/dictionary.c.old	2003-01-09 20:11:04.000000000 +0000
--- ./gnome-spell/dictionary.c	2003-01-09 20:11:25.000000000 +0000
***************
*** 201,207 ****
  	GNOME_Spell_StringSeq *seq = NULL;
  	gint i;
  
! 	g_return_if_fail (word);
  
  	DICT_DEBUG (printf ("Dictionary correction: %s\n", word));
  	update_manager (dict, ev);
--- 201,207 ----
  	GNOME_Spell_StringSeq *seq = NULL;
  	gint i;
  
! 	g_return_val_if_fail( word, NULL);
  
  	DICT_DEBUG (printf ("Dictionary correction: %s\n", word));
  	update_manager (dict, ev);

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. compile program
2.
3.
    

Additional info

Comment 1 Jeremy Katz 2003-01-12 19:21:54 UTC
That fix is bogus -- g_return_if_fail is a define that just returns in cases of
failure, so you don't get an int returned in error cases so just whatever is on
the stack is returned, but it's an assertion for a "never should happen" case. 
If you want to pursue it further, please file upstream at
http://bugzilla.ximian.com.

Comment 2 d.binderman 2003-01-12 20:45:25 UTC
>whatever is on the stack is returned, 
>but it's an assertion for a "never should happen" case. 

If you think it's a good idea to return random rubbish in the
"should never happen" case, then there isn't much more I can
sensibly say.

>If you want to pursue it further, please file upstream at
>http://bugzilla.ximian.com.

I'll have a think about it.