Re: int* array going astray

2009-11-24 Thread James Maxwell
Thanks again, folks. Will definitely enable those checks. cheers, J. On 2009-11-24, at 9:44 PM, Jens Alfke wrote: > > On Nov 24, 2009, at 8:56 PM, Graham Cox wrote: > >> The warning you want is 'possible unwanted assignment', and I think it comes >> with the -Wall flag. > > Yup. I vehement

Re: int* array going astray

2009-11-24 Thread Jens Alfke
On Nov 24, 2009, at 8:56 PM, Graham Cox wrote: > The warning you want is 'possible unwanted assignment', and I think it comes > with the -Wall flag. Yup. I vehemently assert that all projects should be built with -Wall and -Werror. It will save you so much time and frustration. —Jens ___

Re: int* array going astray

2009-11-24 Thread Graham Cox
On 25/11/2009, at 3:35 PM, James Maxwell wrote: > (funny that I didn't get a warning, actually... Is there any build setting > that will protect me from a similar bought of blindness in the future?) The warning you want is 'possible unwanted assignment', and I think it comes with the -Wall fl

Re: int* array going astray

2009-11-24 Thread James Maxwell
oh, thanks! I didn't know that "people" did that. But now I do! Certainly makes sense. cheers, J. On 2009-11-24, at 8:39 PM, Luke the Hiesterman wrote: > This is why some people write if (0 == _state[i]). A mistake there will > definitely generate a compiler error. > > Luke > > On Nov 24,

Re: int* array going astray

2009-11-24 Thread Luke the Hiesterman
This is why some people write if (0 == _state[i]). A mistake there will definitely generate a compiler error. Luke On Nov 24, 2009, at 8:35 PM, James Maxwell wrote: how do you spell total frustration and stupidity? how about writing: if(_state[i] = 0) when you really mean: if(_state[i] ==

Re: int* array going astray

2009-11-24 Thread James Maxwell
how do you spell total frustration and stupidity? how about writing: if(_state[i] = 0) when you really mean: if(_state[i] == 0) how many hours did I waste trying to find that?. ugh Certainly a simple enough way to make sure a vector isn't retained! (funny that I didn't get a warning, a

Re: int* array going astray

2009-11-24 Thread James Maxwell
Hey Folks, Thanks for the responses. I'm doing some testing to specifically isolate the instance that's giving me the problem, so "self" should definitely be the right one. There's no persistence stuff written at all yet, so it can't be initWithCoder. I'm using a totally vanilla synthesized acc

Re: int* array going astray

2009-11-24 Thread Michael Babin
On Nov 24, 2009, at 6:20 PM, James Maxwell wrote: > I have a couple of int* arrays I'm using as instance variables - they're > declared in my @interface section, and inited using malloc when I init the > object (and free()'d in the dealloc). I can set them, using standard array > notation (i.e.

Re: int* array going astray

2009-11-24 Thread Graham Cox
On 25/11/2009, at 11:20 AM, James Maxwell wrote: > I have a couple of int* arrays I'm using as instance variables - they're > declared in my @interface section, and inited using malloc when I init the > object (and free()'d in the dealloc). I can set them, using standard array > notation (i.e.

int* array going astray

2009-11-24 Thread James Maxwell
I have a couple of int* arrays I'm using as instance variables - they're declared in my @interface section, and inited using malloc when I init the object (and free()'d in the dealloc). I can set them, using standard array notation (i.e., number[i] = 7) while I'm in a given method, but the value