NetBSD Problem Report #6184

Received: (qmail 17604 invoked from network); 21 Sep 1998 11:04:46 -0000
Message-Id: <199809211104.NAA18452@peti.gmd.de>
Date: Mon, 21 Sep 1998 13:04:31 +0200 (CEST)
From: Peter Simons <simons@peti.gmd.de>
Reply-To: simons@peti.gmd.de
To: gnats-bugs@gnats.netbsd.org
Subject: /usr/include/machine/limits.h and egcs
X-Send-Pr-Version: 3.95

>Number:         6184
>Category:       misc
>Synopsis:       /usr/include/machine/limits.h and egcs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 21 04:05:00 +0000 1998
>Closed-Date:    Mon Sep 21 11:09:49 +0000 1998
>Last-Modified:  Mon Sep 21 12:43:06 +0000 1998
>Originator:     Peter Simons
>Release:        NetBSD/i386 1.3
>Organization:

>Environment:

System: NetBSD peti.gmd.de 1.3 NetBSD 1.3 (PETI) #1: Wed Feb 11 13:59:52 CET 1998 simons@peti.gmd.de:/usr/src/sys/arch/i386/compile/PETI i386


>Description:

When installing egcs 1.1 as an additional compiler into NetBSD 1.3,
egcs installs its own version of the limits.h header file.
Unfortunately compiling sources might yield warnings, because the
limits.h file of NetBSD will re-define these symbols:

 | simons@peti:~/src/mfo/source$ g++ -Wall -ansi -pedantic -c main.cpp
 | In file included from /usr/include/sys/param.h:102,
 |               from /usr/include/netdb.h:64,
 |               from include/../include/socket++.hpp:52,
 |               from listener.hpp:43,
 |               from ./main.cpp:41:
 | /usr/include/machine/limits.h:41: warning: `SCHAR_MAX' redefined
 | /usr/local/egcs/lib/gcc-lib/i386-unknown-netbsd1.3/egcs-2.92.07/include/limits.h:33:
 |                  warning: this is the location of the previous definition
 |
 | [...]


>How-To-Repeat:

>Fix:

*** /usr/src/sys/arch/i386/include/limits.h     Thu Dec 21 13:28:55 1995
--- /usr/include/machine/limits.h       Mon Sep 21 13:02:41 1998
***************
*** 35,40 ****
--- 35,42 ----
   *    @(#)limits.h    7.2 (Berkeley) 6/28/90
   */

+ #ifndef _GCC_LIMITS_H_        /* Did egcs define those already? */
+
  #define       CHAR_BIT        8               /* number of bits in a char */
  #define       MB_LEN_MAX      1               /* no multibyte characters */

***************
*** 56,61 ****
--- 58,66 ----
  #define       ULONG_MAX       0xffffffffUL    /* max value for an unsigned long */
  #define       LONG_MAX        0x7fffffffL     /* max value for a long */
  #define       LONG_MIN        (-0x7fffffffL-1)        /* min value for a long */
+
+ #endif /* !defined(_GCC_LIMITS_H_) */
+

  #if !defined(_ANSI_SOURCE)
  #define       SSIZE_MAX       INT_MAX         /* max value for a ssize_t */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kleink 
State-Changed-When: Mon Sep 21 04:09:49 PDT 1998 
State-Changed-Why:  
It's not the responsibility of NetBSD headers to work around problems due to 
header file `duplication' done by 3rd-party programs; those should know better. 
>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.