Bug 81683 - bad source code
bad source code
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gnome-spell (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-12 13:42 EST by d.binderman
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-12 14:21:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-01-12 13:42:51 EST
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 14:21:54 EST
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 15:45:25 EST
>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.

Note You need to log in before you can comment on or make changes to this bug.