Red Hat Bugzilla – Bug 136089
missing return stmt
Last modified: 2007-11-30 17:10:52 EST
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
/* Now let's see who complains... */
debug(F100,"xgnbyte switch failure","",0);
#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):
Steps to Reproduce:
I can't reproduce this warning. Which version of gcc do u use? I use
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.
>I can't reproduce this warning. Which version of gcc do u use? I use
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 ?