Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!pacbell.com!ames!dftsrv!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: just to let you know... Message-ID: <1990Jul6.135736.4666@eng.umd.edu> Date: 6 Jul 90 13:57:36 GMT References: <102102@tiger.oxy.edu> <55662@microsoft.UUCP> Sender: news@eng.umd.edu (The News System) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 32 In article <55662@microsoft.UUCP> jamesth@microsoft.UUCP (James THIELE) writes: >In article <102102@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes: >|I simply had an array of booleans like this: Boolean monitor[3]; >|simple enough. However, in my code I hade this: >| >|Boolean someBoolean, >| anotherBoolean; >| monitor[3]; >| >|Think C (4.00) compiled this with no complaints (don't ask me what it >|thought monitor[3]; means, I don't know...) so it appears to be a bug. > >If it's like most C compilers, it thinks monitor[3] is an array if ints. > >To quote "The C Programming Language", Kernighan and Ritchie, First >Edition, Appendix A, Section 13 Implicit declarations, "In a declaration >inside a function, if a storage class but no type is given, the >identifier is assumed to be an int;". > >Not a bug, unless you consider this language feature to be a bug. :-) Actually, whatever that is, it is OUTSIDE a function. Inside a function the statement 'monitor[3]' will be treated as an expression, and the compiler will complain that monitor is undefined. The strange thing is that if monitor[3] IS declared as an array of ints, the code should work-- becuase Boolean is typedefed to short, which in THINK C is the same as int. -- Newsgroups: comp.sys.mac.misc Subject: Re: Expensive doorstops Summary: Expires: