Bug 136089

Summary: missing return stmt
Product: [Fedora] Fedora Reporter: David Binderman <dcb314>
Component: ckermitAssignee: Peter Vrabec <pvrabec>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
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: 2004-10-27 13:45:58 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 David Binderman 2004-10-17 19:41:42 UTC
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 13:45:58 UTC
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 09:58:33 UTC
>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 ?