Subject: misc/4473: machine/limits.h can get included multiple times
To: None <gnats-bugs@gnats.netbsd.org>
From: Mika Nystrom <mika@cs.caltech.edu>
List: netbsd-bugs
Date: 11/12/1997 04:28:21
>Number: 4473
>Category: misc
>Synopsis: machine/limits.h can get included multiple times
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 12 04:35:01 1997
>Last-Modified:
>Originator: Mika Nystrom
>Organization:
Department of Computer Science, California Institute of Technology
>Release: Nov. 1, 1997
>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.
>Audit-Trail:
>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.