Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!microsoft!jamesth From: jamesth@microsoft.UUCP (James THIELE) Newsgroups: comp.sys.mac.programmer Subject: Re: just to let you know... Message-ID: <55662@microsoft.UUCP> Date: 5 Jul 90 17:27:18 GMT References: <102102@tiger.oxy.edu> Reply-To: jamesth@microsoft.UUCP (James THIELE) Organization: Microsoft Corp., Redmond WA Lines: 33 In article <102102@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes: |Yeeeeeeeeehaaaaa! I just solved a problem that's been eatin me for days!! |(Maybe now I can make my deadline!!!) Anyway, I won't go into the details |of the prol_~?oblem--just the cause in case it happens to you... | |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]; | |AHHHHG! Note that there is a semi-colon after anotherBoolean!! (it's |embarrassing to think I was hunting for days to find the root of my problem) | |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. :-) | |Anywho, my code now works withour error, and the world is a happier place | |Ando Moon, programmer at large... James Thiele -- microsoft!jamesth