Bug 116103 - Multiple missing return statements
Multiple missing return statements
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rdist (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-18 05:27 EST by d.binderman
Modified: 2015-03-04 20:13 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-14 08:31:14 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 d.binderman 2004-02-18 05:27:12 EST
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 08:55:43 EST
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 12:09:47 EST
>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 08:31:14 EDT
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 08:34:27 EDT
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

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