Bug 81683 - bad source code
Summary: bad source code
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-spell (Show other bugs)
(Show other bugs)
Version: 8.0
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-12 18:42 UTC by d.binderman
Modified: 2008-05-01 15:38 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.



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