NetBSD Problem Report #205

From gnats  Wed Apr  6 15:15:13 1994
Received: from forte (forte.mathematik.uni-Bremen.de [134.102.232.1]) by sun-lamp.cs.berkeley.edu (8.6.8/8.6.6) with ESMTP id PAA13697 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 6 Apr 1994 15:13:04 -0700
Message-Id: <199404062212.AAA02676@forte>
Date: Thu, 7 Apr 1994 00:12:18 +0200
From: thomas@mathematik.uni-Bremen.de
Reply-To: thomas@mathematik.uni-Bremen.de
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: MIN & MAX should be ifdef'd for user code in sys/param.h
X-Send-Pr-Version: 3.2

>Number:         205
>Category:       lib
>Synopsis:       MIN & MAX should be ifdef'd for user code in sys/param.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 06 15:20:04 +0000 1994
>Closed-Date:    Sun Jun 19 23:04:54 +0000 1994
>Last-Modified:  
>Originator:     Thomas Eberhardt
>Release:        
>Organization:
CeVis, University of Bremen, Germany
>Environment:

System: NetBSD ed209 0.9a ED209#0 i386

Machine: i386
>Description:
	After too many warnings from compilation of various sources, I've
	come to the conclusion that MIN & MAX should be ifdef'd for user
	code in sys/param.h.
>How-To-Repeat:

>Fix:
*** sys/param.h-	Thu Jan 13 11:45:26 1994
--- sys/param.h	Fri Apr  1 03:06:52 1994
***************
*** 185,192 ****
--- 185,196 ----
  #define	MIN(a,b) min((a), (b))
  #define	MAX(a,b) max((a), (b))
  #else
+ #ifndef MIN
  #define	MIN(a,b) (((a)<(b))?(a):(b))
+ #endif
+ #ifndef MAX
  #define	MAX(a,b) (((a)>(b))?(a):(b))
+ #endif
  #endif

  /*
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Sun Jun 19 16:04:54 PDT 1994 
State-Changed-Why:  
no. why: 
(1) no header will automatically include <sys/param.h> 
for you; if you include it, you're screwing yourself. 
(2) it's standard practice for <sys/param.h> to include them 
unconditionally. 
(3) you shouldn't be including <sys/param.h> _after_ other 
headers; in general <sys/...> headers should be included 
before "user-land" headers, therefore this change doesn't 
buy you much. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.