Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz)
Subject: Re: DEC OSF/1 2.0 limits.h and core dump using INT_MAX
Date: 6 Jun 1994 08:32:34 GMT	[thread overview]
Message-ID: <2sumv2INN4os@usenet.pa.dec.com> (raw)
In-Reply-To: richmCqxq7o.170@netcom.com

In article <richmCqxq7o.170@netcom.com> richm@netcom.com (Richard Mauri) writes:
>I am beginning a port of a large system to DEC alpha 3000 OSF/1 2.0.
>We had code that was expecting long to be 32 bits and using limits.h
>LONG_MAX to initialize them. In an effort to test a solution replacing
>long's with a typedef'd INT_32 int and LONG_MAX with INT_MAX I discovered
>to things that I was hoping someone could shed somre light on.
>
>1. limits.h does not define LONG_MAX, INT_MAX like my trusty POSIX
>complience guide says it should. They appear to be set by cpp or cc.
>With all the hype about DEC's standard compliance this strikes me as strange.

If you have truely standard conforming software, you should compile
with -D_ANSI_C_SOURCE and limits.h will include <machine/machlimits.h>
to define them. The problem is that we're trying to conform to several
partly contradictory standards, hence sometimes the need to set defines
to distinguish which one you want. All of that is described in the
programmers manual.

>2. If I write, compile and run a trivial program:
>/* no need for 
>#include <limits.h>
>as far as default cc is concerned.
>*/
>main()
>{
>	char c[MAX_INT];
>}
>It core dumps at run time. Very strange and definitely a bug IMHO.

You're overrunning your stack allocation. Try and change it to
slightly less (a few hundred bytes) less than the output
of

	limit stacksize

(probably also do a  "unlimit stacksize" to get the maximum your
kernel configuration allows to, that's 32 Mbyte on my 2.0 system).

		Burkhard Neidecker-Lutz

Distributed Multimedia Group, CEC Karlsruhe 
Advanced Technology Group, Digital Equipment Corporation
neideck@nestvx.enet.dec.com


      parent reply	other threads:[~1994-06-06  8:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-06-05 17:35 DEC OSF/1 2.0 limits.h and core dump using INT_MAX Richard Mauri
1994-06-06  0:17 ` Dirk Grunwald
1994-06-06  8:32 ` Burkhard Neidecker-Lutz [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox