[Zodb-checkins] CVS: Zope3/lib/python/Persistence/BTrees - BTreeModuleTemplate.c:1.1.2.17
Tim Peters
tim@zope.com
Sun, 9 Jun 2002 23:31:40 -0400
> Modified Files:
> Tag: Zope-3x-branch
> BTreeModuleTemplate.c
> Log Message:
> - Silence whiny complaint from gcc about 'ambiguous else'.
>
> === Zope3/lib/python/Persistence/BTrees/BTreeModuleTemplate.c
> 1.1.2.16 => 1.1.2.17 ===
> */
> DECREF_KEY(i->key);
> - if (i->usesValue)
> + if (i->usesValue) {
> DECREF_VALUE(i->value);
> + }
> }
> i->position = -1; /* stop any stray next calls from doing harm */
> }
Yuck. All these BTree changes are on the trunk, too. I've been sticking in
extra curlies at times, since Jeremy did one of these fixup patches, but I'm
not using gcc and confess I haven't been able to guess when gcc will
complain. For example, in the above, there was already an enclosing
close-curly, so it's hard to imagine what the complaint is getting at. I
suppose it's because DECREF_VALUE expands to Py_DECREF in some cases, and
the latter expands to an if/else too.
Oh well. If anyone has an algorithm for predicting when gcc will complain
short of actually running it <wink>, lemme know and I'll be happy to fix
these before checking them in ...