> On 28 Dec 2014, at 8:07 pm, jan i <[email protected]> wrote: > > On 28 December 2014 at 13:36, Peter Kelly <[email protected]> wrote: > >> Actually it does, but I just saw the for (i; …) which Xcode was giving an >> “Expression result unused” warning. A better fix would be just to remove >> that all together, so we have for (; allGroups[i] && strcmp(argv[2], >> allGroups[i]->name); i++) ; - there’s no need to mention the i variable in >> the initialisation phase. I’ll commit this in shortly. >> > > Interesting, with VC (windows) the "if" after the loop never sees the "i" > from the loop, its always 0. Seems Xcode has a more relaxed view on scoping > rules, good to know.
Yes, it’s initialised to 0 immediately before. I missed that, and just looked at the line containing the warning, and (erroneously) assumed that it was a variable declared without type. I realised afterwards that what you had is correct, apart from the (trivial) warning in Xcode about the variable not being referenced. — Dr Peter M. Kelly [email protected] PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
