On Tue, 12 Aug 2003, Tony Pan wrote: > ======= > - Functions which have variables declared within multiple blocks where code > within the block requires the use of temporary memory may be get corrupted > when compiled with global optimizations. A work around is to move the > variable outside of the block. > ======= > > For example, it you have code like below the compiler *may* mess up your > program: > > unsigned char foo1() > { > unsigned char i; > i = 1; > foo2(); > return i; // should return 1 > } > > void foo2() > { > unsigned char i; > // code here... > i = 2; > // code here... > } I don't believe the example you show relates to the bug you cite. Functions with "variables in multiple blocks" means something like this: void foo(void) { char i; if (var) { char j; /* ... */ } } I don't believe the example you show should break. -- John W. Temples, III -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.