Path: utzoo!attcan!uunet!bellcore!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!mailer.cc.fsu.edu!sun13!gw.scri.fsu.edu!pepke From: pepke@gw.scri.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: THINKC 4.0.2 #define is short Message-ID: <1398@sun13.scri.fsu.edu> Date: 14 Nov 90 15:53:23 GMT References: <2374@moscom.UUCP> Sender: news@sun13.scri.fsu.edu Organization: Florida State University, but I don't speak for them Lines: 41 In article <2374@moscom.UUCP> tcm@moscom.UUCP (Tom Maszerowski) writes: > I believe that this is because the preprocessor assumes that > MaxAllocation is an int ( 16 bits ) but the result of the shift is > 0x10000, which requires a long ( 32 bits ). No, it depends on how you use it. Preprocessing is textual. Try this bit of code: #define foo (1 << 16) #define bar (1L << 16) long face, bork; printf("Foo = %ld\n", (long) foo); printf("Bar = %ld\n", (long) bar); face = foo; bork = bar; printf("Face = %ld\n", face); printf("Bork = %ld\n", bork); It produces Foo = 65536 Bar = 65536 Face = 0 Bork = 65536 > I realize that compiler > implementers are free to make an int any size they want, but this is the > first 68000 C compiler I've used where sizeof(int) != sizeof(long). Whether this is "proper" or not is the subject of one of the loudest and least productive of the periodic flame wars that grace this newsgroup. It's like zen and Mount Everest: it's just there. Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.