Bug 15906

Summary: rcmd(3) prototype disagrees with definition
Product: Base System Reporter: Christian Weisgerber <naddy>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description Christian Weisgerber 2000-01-05 14:10:01 UTC
What's the type of rcmd(3)'s second parameter, int or u_short?

Man page:
    int
    rcmd(char **ahost, int inport, const char *locuser, const char *remuser,
         const char *cmd, int *fd2p)

Prototype in /usr/include/unistd.h:
    int rcmd __P((char **, int, const char *,
                  const char *, const char *, int *));

Actual definition in src/lib/libc/net/rcmd.c:
    int
    rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
        char **ahost;
        u_short rport;
        const char *locuser, *remuser, *cmd;
        int *fd2p;

Which instances should be fixed?
Comment 1 Garrett A. Wollman 2000-01-05 17:30:19 UTC
<<On Wed, 5 Jan 2000 15:01:35 +0100 (CET), Christian Weisgerber <naddy@mips.rhein-neckar.de> said:

>> Synopsis:       rcmd(3) prototype disagrees with definition

No, it does not.

>     int rcmd __P((char **, int, const char *,
>                   const char *, const char *, int *));

This is the correct prototype for a declaration of the form:

>     int
>     rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
>         char **ahost;
>         u_short rport;
>         const char *locuser, *remuser, *cmd;
>         int *fd2p;

> Which instances should be fixed?

Neither.  Please read a text on Standard C, such as K&R or H&S.

-GAWollman
Comment 2 Christian Weisgerber 2000-01-05 23:35:40 UTC
Garrett Wollman:

> >> Synopsis:       rcmd(3) prototype disagrees with definition
> 
> No, it does not.

Indeed. Please close the PR. Sorry for wasting everybody's time.
I should have noticed that this is all throughout the tree.

> Please read a text on Standard C, such as K&R or H&S.

Sigh. I found it, section A7.3.2 in K&Rv2. Integral promotion of
integral type arguments and parameters for old style function
declarations.

-- 
Christian "naddy" Weisgerber                  naddy@mips.rhein-neckar.de
Comment 3 Steve Price freebsd_committer freebsd_triage 2000-01-06 02:27:33 UTC
State Changed
From-To: open->closed

Closed at originator's request.