From yasu@home.utahime.org  Fri Apr  4 01:18:44 2014
Return-Path: <yasu@home.utahime.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 9ECF780A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Apr 2014 01:18:44 +0000 (UTC)
Received: from gate.utahime.jp (ipq210.utahime.jp [183.180.29.210])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D96068A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  4 Apr 2014 01:18:43 +0000 (UTC)
Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1])
	by gate.utahime.jp (Postfix) with ESMTP id 06AF34E629;
	Fri,  4 Apr 2014 10:18:42 +0900 (JST)
Received: from eastasia.home.utahime.org (localhost [127.0.0.1])
	by localhost-backdoor.home.utahime.org (Postfix) with ESMTP id C1D0F75928;
	Fri,  4 Apr 2014 10:18:41 +0900 (JST)
Received: by eastasia.home.utahime.org (Postfix, from userid 1000)
	id 71EEB7591D; Fri,  4 Apr 2014 10:18:41 +0900 (JST)
Message-Id: <20140404011841.71EEB7591D@eastasia.home.utahime.org>
Date: Fri,  4 Apr 2014 10:18:41 +0900 (JST)
From: Yasuhiro KIMURA <yasu@utahime.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] include/rpcsvc/yp_prot.h: remove typedef of bool.
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         188247
>Category:       kern
>Synopsis:       [rpc] [patch] include/rpcsvc/yp_prot.h: remove typedef of bool.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 04 01:20:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Wed Apr 16 01:32:22 UTC 2014
>Originator:     Yasuhiro KIMURA
>Release:        FreeBSD 10.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD eastasia.home.utahime.org 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260673: Thu Jan 23 22:36:39 JST 2014 root@eastasia.home.utahime.org:/usr0/freebsd/src/obj/usr0/freebsd/src/releng_10_0/src/sys/EASTASIA amd64


	
>Description:
	
	There have been typedef of bool in rpcsvc/yp_prot.h since it
	is added to source tree in August 1994. But there is also
	definition of bool in stdbool.h, and they conflict when both
	headers are used. An acutual example of conflict is building
	Zsh on NIS client of 10.x or later. It is already repoted as
	following PR.

	ports/183253: [PATCH] shells/zsh: fail to build on 10.0-BETA1
	http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183253

	While stdbool.h and bool definition in it are requirement of
	C99 standard, it seems bool typedef in ryp_prot.h is not
	necessarily required. So removing the latter is a solution.

	There are some reasons that removing bool typedef from
	yp_prot.h doesn't seems to cause problem.

	* Building and installing FreeBSD seems to work fine without
          it. I applied attached patch to 8.4-RELEASE, 9.2-RELEASE and
          10.0-RELEASE source tree and tried regular rebuilding steps
          described in /usr/src/Makefile. All rebuild succeeded
          without error, and all of reinstalled systems seems to work
          fine.
	* NetBSD have already removed it in October 2007, and since
          then they have been done well.

>How-To-Repeat:
	
>Fix:

	

--- patch-src_include_rpcsvc_yp_prot.h begins here ---
Index: include/rpcsvc/yp_prot.h
===================================================================
--- include/rpcsvc/yp_prot.h	(revision 260673)
+++ include/rpcsvc/yp_prot.h	(working copy)
@@ -67,11 +67,6 @@
  * YPPROC_MAPLIST	takes (char *), returns (struct ypmaplist *).
  */
 
-#ifndef BOOL_DEFINED
-typedef u_int bool;
-#define BOOL_DEFINED
-#endif
-
 /* Program and version symbols, magic numbers */
 
 #define YPPROG		((u_long)100004)
--- patch-src_include_rpcsvc_yp_prot.h ends here ---


>Release-Note:
>Audit-Trail:

From: Bruce Evans <brde@optusnet.com.au>
To: Yasuhiro KIMURA <yasu@utahime.org>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: kern/188247: [PATCH] include/rpcsvc/yp_prot.h: remove typedef
 of bool.
Date: Fri, 4 Apr 2014 18:57:41 +1100 (EST)

 On Fri, 4 Apr 2014, Yasuhiro KIMURA wrote:
 
 >> Description:
 >
 > 	There have been typedef of bool in rpcsvc/yp_prot.h since it
 > 	is added to source tree in August 1994. But there is also
 > 	definition of bool in stdbool.h, and they conflict when both
 > 	headers are used. An acutual example of conflict is building
 > 	Zsh on NIS client of 10.x or later. It is already repoted as
 > 	following PR.
 >
 > 	ports/183253: [PATCH] shells/zsh: fail to build on 10.0-BETA1
 > 	http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183253
 >
 > 	While stdbool.h and bool definition in it are requirement of
 > 	C99 standard, it seems bool typedef in ryp_prot.h is not
 > 	necessarily required. So removing the latter is a solution.
 
 rpc seems to have been only partly converted from using bool to using
 bool_t.
 
 > 	There are some reasons that removing bool typedef from
 > 	yp_prot.h doesn't seems to cause problem.
 
 Many places still use bool.  E.g.:
 
     rpc/rpcb_prot.x
     rpcsvc/klm_prot.x
     rpcsvc/nfx_prot.x
     rpcsvc/nis.x
     rpcsvc/nis_callback.x
     rpcsvc/nlm_prot.x
     rpcsvc/rquota.x
     rpcsvc/yp.x
     rpcsvc/ypprot.h (this definition)
     rpcsvc/ypxfrd.x
 
 None of these places include stdbool.h, and neither does your patch, so
 it is unclear how anything works.
 
 > 	* Building and installing FreeBSD seems to work fine without
 >          it. I applied attached patch to 8.4-RELEASE, 9.2-RELEASE and
 >          10.0-RELEASE source tree and tried regular rebuilding steps
 >          described in /usr/src/Makefile. All rebuild succeeded
 >          without error, and all of reinstalled systems seems to work
 >          fine.
 > 	* NetBSD have already removed it in October 2007, and since
 >          then they have been done well.
 >
 > --- patch-src_include_rpcsvc_yp_prot.h begins here ---
 > Index: include/rpcsvc/yp_prot.h
 > ===================================================================
 > --- include/rpcsvc/yp_prot.h	(revision 260673)
 > +++ include/rpcsvc/yp_prot.h	(working copy)
 > @@ -67,11 +67,6 @@
 >  * YPPROC_MAPLIST	takes (char *), returns (struct ypmaplist *).
 >  */
 >
 > -#ifndef BOOL_DEFINED
 > -typedef u_int bool;
 > -#define BOOL_DEFINED
 > -#endif
 > -
 > /* Program and version symbols, magic numbers */
 >
 > #define YPPROG		((u_long)100004)
 > --- patch-src_include_rpcsvc_yp_prot.h ends here ---
 
 Including stdbool.h should work in most cases, but the standard bool
 can be almost anything.  It might have a different size.  Then there
 might be ABI breakage from using it.  The fake version in stdbool.h
 for compilers that don't support it has type int.  This has the same
 size, but different signedness.
 
 Bruce
>Unformatted:
