Subject: bin/4036: /src/include/rpc/rpc.h should not include
To: None <gnats-bugs@gnats.netbsd.org>
From: None <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 08/25/1997 10:07:18
>Number:         4036
>Category:       bin
>Synopsis:       /src/include/rpc/rpc.h should not include <rpc/pmap_rmt.h>
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 25 01:20:01 1997
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private
	
>Release:        <NetBSD-current source date> NetBSD current 24.08.1997
>Environment:
	
System: NetBSD i41lt1 1.2G NetBSD 1.2G (CYBERLAP) #0: Sun Aug 24 23:13:46 CEST 1997 frueauf@cyberlap:/usr/src/sys/arch/i386/compile/CYBERLAP i386


>Description:
	
Recently /src/include/rpc/rpc.h was changed to include "<rpc/pmap_rmt.h>".
This should get removed again, because it causes conflicts when compiling
/src/usr.sbin/portmap/portmap.c; at least "struct rmtcallargs" and
"xdr_rmtcall_args()" are used with identical names but different definitions.

While I am at it: portmap.c includes "<rpc/pmap_prot.h>" - this can get
removed now, as <rpc/rpc.h> gets included too, which now has this include
inside.

>How-To-Repeat:
	
Try to compile /src/usr.sbin/portmap on a current NetBSD system and watch:

cc -O -O4 -m486 -Werror  -c /usr/src/usr.sbin/portmap/portmap.c
/usr/src/usr.sbin/portmap/portmap.c:403: redefinition of `struct rmtcallargs'
cc1: warnings being treated as errors
/usr/src/usr.sbin/portmap/portmap.c:413: warning: static declaration for `xdr_rmtcall_args' follows non-static
*** Error code 1

>Fix:
	
Either remove "#include <rpc/pmap_rmt.h>" from /src/include/rpc/rpc.h like
suggested below, or rewrite the collisions so that they match again.

The following patch fixed the problems described above for me:

*** rpc.h-orig	Mon Aug 25 09:47:21 1997
--- rpc.h	Mon Aug 25 09:47:40 1997
***************
*** 71,77 ****
  /* Portmapper client, server, and protocol headers */
  #include <rpc/pmap_clnt.h>
  #include <rpc/pmap_prot.h>
- #include <rpc/pmap_rmt.h>
  
  /*
   * COMMENT OUT THE NEXT INCLUDE (or add to the #ifndef) IF RUNNING ON
--- 71,76 ----
*** portmap.c-orig	Mon Aug 25 09:48:13 1997
--- portmap.c	Mon Aug 25 09:48:39 1997
***************
*** 82,88 ****
   */
  
  #include <rpc/rpc.h>
- #include <rpc/pmap_prot.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
--- 82,87 ----
>Audit-Trail:
>Unformatted:
/src/include/rpc/rpc.h should not include <rpc/pmap_rmt.h>