Bug 136089 - missing return stmt
missing return stmt
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ckermit (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-17 15:41 EDT by David Binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-27 09:45:58 EDT
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 David Binderman 2004-10-17 15:41:42 EDT
Description of problem:

I just tried to compile package ckermit-8.0.209-8 from
Redhat Fedora Core 3 Test 3.

The compiler said

ckcfns.c(2493): warning #1011: missing return statement at end of
non-void function "xgnbyte"

The source code is

    }
#ifdef COMMENT
    /* Now let's see who complains... */
    debug(F100,"xgnbyte switch failure","",0);
    return(-2);
#endif /* COMMENT */
}

Suggest there is at least one path through the code where a return
statement is not executed. Suggest add one at the end of the routine.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Peter Vrabec 2004-10-27 09:45:58 EDT
I can't reproduce this warning. Which version of gcc do u use? I use
gcc 3.3.3.

And there're "return" statements in each "case"(include default) of
last "switch" so i don't thing, there is a path through the code where
a return statement is not executed.

Comment 2 David Binderman 2004-10-28 05:58:33 EDT
>I can't reproduce this warning. Which version of gcc do u use? I use
gcc 3.3.3.

Sorry, my mistake. I should have mentioned that I use Intel v8.1
compiler. It is much beter than gnu cc.

>i don't thing, there is a path through the code where
>a return statement is not executed.

Interesting. What happens when COMMENT is not defined ?

It looks to me and the compiler like the machine just falls off the
end of the routine.

Maybe the #endif and the return statement should be swapped ?

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