Path: utzoo!mnetor!uunet!husc6!bbn!rochester!udel!gatech!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: Constant overflow Message-ID: <675@xyzzy.UUCP> Date: 7 Mar 88 19:35:44 GMT References: <2747@mmintl.UUCP> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 20 In article <2747@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: | Try this one on your favorite C compiler. So far, every one I've tried | (including lint) has had no complaint: | | long i = 9876543210L; | | (The problem, of course, is that that number doesn't fit in 32 bits. If | your compiler has a word size of more than 32 bits, try something big | enough to overflow whatever it uses.) Ok, on the Data General C compiler, you get: Error 104 severity 2 beginning on line 1 (Line 1 of file foo.c) long i = 9876543210L; ^ The int constant "9876543210L" could not fit into 32 bits without a loss of precision. The compiler truncated it on the left. -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa/Csnet: meissner@dg-rtp.DG.COM