From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8badcbdbf5b9d34e X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-06-06 02:02:28 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!pipex!sunic!EU.net!uunet!gatekeeper.us.oracle.com!decwrl!pa.dec.com!nestvx.enet.dec.com!neideck From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz) Newsgroups: comp.unix.osf.osf1 Subject: Re: DEC OSF/1 2.0 limits.h and core dump using INT_MAX Date: 6 Jun 1994 08:32:34 GMT Organization: CEC Karlsruhe Message-ID: <2sumv2INN4os@usenet.pa.dec.com> References: NNTP-Posting-Host: BIER In article 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 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 >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