From modulus@xor.sqrt.ca  Wed Aug 28 21:49:55 2002
Return-Path: <modulus@xor.sqrt.ca>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B7DC637B400
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 21:49:55 -0700 (PDT)
Received: from xor.sqrt.ca (h24-82-193-97.wp.shawcable.net [24.82.193.97])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A970D43E42
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 21:49:49 -0700 (PDT)
	(envelope-from modulus@xor.sqrt.ca)
Received: from xor.sqrt.ca (smmsp@localhost [127.0.0.1])
	by xor.sqrt.ca (8.12.5/8.12.5) with ESMTP id g7T4nmwZ096735
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Aug 2002 23:49:48 -0500 (CDT)
	(envelope-from modulus@xor.sqrt.ca)
Received: (from root@localhost)
	by xor.sqrt.ca (8.12.5/8.12.5/Submit) id g7T4nldi096734;
	Wed, 28 Aug 2002 23:49:47 -0500 (CDT)
Message-Id: <200208290449.g7T4nldi096734@xor.sqrt.ca>
Date: Wed, 28 Aug 2002 23:49:47 -0500 (CDT)
From: "Chris S.J. Peron" <maneo@bsdpro.com>
Reply-To: "Chris S.J. Peron" <maneo@bsdpro.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] gnu: libobjc redefines MIN and MAX macros
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42154
>Category:       gnu
>Synopsis:       [patch] gnu: libobjc redefines MIN and MAX macros
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 21:50:01 PDT 2002
>Closed-Date:    Thu Nov 13 14:53:54 PST 2003
>Last-Modified:  Thu Nov 13 14:53:54 PST 2003
>Originator:     Chris S.J. Peron
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD xor.sqrt.ca 4.6-STABLE FreeBSD 4.6-STABLE #3: Tue Aug 13 17:17:48 CDT 2002 cperon@xor.sqrt.ca:/usr/src/sys/compile/opcode i386


	
>Description:

libobjc redefines the MIN and MAX macros previously defined in
sys/param.h. During a buildworld warnings are issued:

/usr/src/gnu/lib/libobjc/../../../contrib/libobjc/encoding.c:35: \
	warning: `MAX' redefined
/usr/obj/usr/src/i386/usr/include/sys/param.h:214: \
	warning: this is the location of the previous definition
/usr/src/gnu/lib/libobjc/../../../contrib/libobjc/encoding.c:39: \
	warning: `MIN' redefined
/usr/obj/usr/src/i386/usr/include/sys/param.h:213: \
	warning: this is the location of the previous definition
	
	
>How-To-Repeat:
	compile libobjc
	
>Fix:

--- /usr/src/contrib/libobjc/encoding.c.bak	Wed Aug 28 23:36:04 2002
+++ /usr/src/contrib/libobjc/encoding.c	Wed Aug 28 23:36:40 2002
@@ -30,13 +30,16 @@
 #include "objc-api.h"
 #include "encoding.h"
 
+#if (!defined(MAX))
 #define MAX(X, Y)                    \
   ({ typeof(X) __x = (X), __y = (Y); \
      (__x > __y ? __x : __y); })
-
+#endif
+#if (!defined(MIN))
 #define MIN(X, Y)                    \
   ({ typeof(X) __x = (X), __y = (Y); \
      (__x < __y ? __x : __y); })
+#endif
 
 #define ROUND(V, A) \
   ({ typeof(V) __v=(V); typeof(A) __a=(A); \

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->kan 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 17:20:44 PDT 2003 
Responsible-Changed-Why:  
Assign to gcc maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42154 
State-Changed-From-To: open->closed 
State-Changed-By: kan 
State-Changed-When: Thu Nov 13 14:51:32 PST 2003 
State-Changed-Why:  
The bug is fixed in GCC 3.x series. GCC 2.95.x is closed for development. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42154 
>Unformatted:
