NetBSD Problem Report #4473

Received: (qmail 15842 invoked from network); 12 Nov 1997 12:29:22 -0000
Message-Id: <199711121228.EAA08923@varese.cs.caltech.edu>
Date: Wed, 12 Nov 1997 04:28:21 -0800 (PST)
From: Mika Nystrom <mika@cs.caltech.edu>
Reply-To: mika@cs.caltech.edu
To: gnats-bugs@gnats.netbsd.org
Subject: machine/limits.h can get included multiple times
X-Send-Pr-Version: 3.95

>Number:         4473
>Category:       misc
>Synopsis:       machine/limits.h can get included multiple times
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 12 04:35:01 +0000 1997
>Closed-Date:    Fri Jan 09 22:22:51 +0000 1998
>Last-Modified:  Fri Apr 25 09:09:39 +0000 2008
>Originator:     Mika Nystrom
>Release:        Nov. 1, 1997
>Organization:
   Department of Computer Science, California Institute of Technology
>Environment:

System: NetBSD varese.cs.caltech.edu 1.3_ALPHA NetBSD 1.3_ALPHA (VARESE) #1: Sat Nov 1 22:44:13 PST 1997 mika@varese:/usr/src/sys/arch/i386/compile/VARESE i386


>Description:
    A user of the system sent me this email:
>
>How-To-Repeat:
	strange includes in C programs that refer to machine/limits.h

>Fix:
        easy fix: bracket machine/limits.h with #ifndef _MACHINE_LIMITS_H,
   but perhaps there's some design issue involved here that I am not 
aware of.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: perry 
State-Changed-When: Fri Jan 9 14:22:51 PST 1998 
State-Changed-Why:  
Fixed on all ports 

>Unformatted:
 >> Why are you including <machine/limits.h>?  This makes your code non-
 >> portable, since ANSI C specifies <limits.h>, not <machine/limits.h>.
 >> If you include <limits.h>, that will grab <machine/limits.h> for you,
 >> keep you on the right side of ANSI, and do the check for double
 >> includes, all at once!
 >
 >I'm not.  "I" am using /usr/include/arpa/inet.h, which includes
 >/usr/include/sys/param.h, which includes the miscreant file in
 >question.
 >
 >However, simply rearranging include files in the original file seems
 >to have bought me something, so my complaint is no longer urgent.

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.