From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8badcbdbf5b9d34e,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-06-05 10:51:12 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!netcomsv!netcom.com!richm From: richm@netcom.com (Richard Mauri) Subject: DEC OSF/1 2.0 limits.h and core dump using INT_MAX Message-ID: Organization: Netcom Online Communications Services (408-241-9760 login: guest) Date: Sun, 5 Jun 1994 17:35:48 GMT 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. 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. Anyone else know about this or experienced such? Rich Mauri