Bug 116103

Summary: Multiple missing return statements
Product: [Fedora] Fedora Reporter: d.binderman
Component: rdistAssignee: Phil Knirsch <pknirsch>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: rvokal
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-04-14 12:31:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description d.binderman 2004-02-18 10:27:12 UTC
Description of problem:

I just tried to compile package rdist-6.1.5-30.1 from Fedora.

The compiler said

1.

gram.y(472): remark #1011: missing return statement at end of non-void
function "insert"
gram.y(499): remark #1011: missing return statement at end of non-void
function "append"
gram.y(508): remark #1011: missing return statement at end of non-void
function "yyerror"
rdist.c(377): remark #1011: missing return statement at end of
non-void function "usage"
rdist.c(430): remark #1011: missing return statement at end of
non-void function "docmdargs"
lookup.c(125): remark #1011: missing return statement at end of
non-void function "define"
setargs.c(90): remark #1011: missing return statement at end of
non-void function "setargs_settup"

Suggest add return statements, or convert these functions to void
return type.



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


How reproducible:


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


Expected results:


Additional info:

Comment 1 Phil Knirsch 2004-02-18 13:55:43 UTC
Bogous error messages from your compiler, in both v1 and v2 sources
these functions are declared and defined already as void.

Read ya, Phil

Comment 2 d.binderman 2004-02-18 17:09:47 UTC
>Bogous error messages from your compiler

The compiler usually produces these messages
for K&R style function definitions, like

f( a, b)
int a;
char b;
{

Note missing return type.

I usually find that upgrading the prototypes to ISO C
fixes the problem.



Comment 3 Phil Knirsch 2004-04-14 12:31:14 UTC
OK, i'll be a more specific:

Looking at gram.y for example the function insert is defined like this:

void
insert(label, files, hosts, subcmds)
        char *label;
        struct namelist *files, *hosts;
        struct subcmd *subcmds;

So it is defined as void and the compiler spits out obviously a wrong
warning.

Same for append() and yyerror() in gram.y, usage() and docmdargs() in
rdist.c, define() in lookup.c and setargs_settup() in setargs.c

Closing this again as not a bug, the compiler is broken resp. spits
out bogous warnings.

Read ya, Phil

Comment 4 Phil Knirsch 2004-04-14 12:34:27 UTC
Actually i just remembered that i fixed a few of the really wrong
function definitions some time ago in the cleanup patch (which also
fixes a miscompilation on ia64).

Please test the latest package from the development tree, that
compiles without a single warning on my system here now.

Read ya, Phil