Thanks, Jeff!

Did you build all of Firefox, or just SpiderMonkey?

There was another similar false positive in clang itself that looked
like |bool HasSpace = ...; use(" /*"+HasSpace)|. Maybe the warning
shouldn't fire if the argument is a bool? (But that wouldn't have
helped in your case.)

Nico

On Fri, Mar 2, 2012 at 8:12 PM, Jeff Walden <[email protected]> wrote:
> For what it's worth, this warning triggers twice when building the 
> SpiderMonkey JavaScript compiler, in two bits of near-adjacent code that look 
> like this:
>
>>     if (attrs) {
>>         int first = 1;
>>         fputs("(", fp);
>> #define DUMP_ATTR(name, display) if (attrs & JSPROP_##name) fputs(" " 
>> #display + first, fp), first = 0
>>         DUMP_ATTR(ENUMERATE, enumerate);
>>         DUMP_ATTR(READONLY, readonly);
>>         DUMP_ATTR(PERMANENT, permanent);
>>         DUMP_ATTR(GETTER, getter);
>>         DUMP_ATTR(SETTER, setter);
>>         DUMP_ATTR(SHARED, shared);
>> #undef  DUMP_ATTR
>>         fputs(") ", fp);
>>     }
>
> (the idea being to print "(enumerate)", "(enumerate readonly)", or whatever 
> depending on attrs; the other instance does likewise for a flags field)
>
> I'm not inclined to defend this technique, although it's not too bad as 
> tricks go.  I think the new warning is a good thing, and I'm perfectly happy 
> to switch those two instances to use &()[] instead.  But it seems worth 
> mentioning here as another data point.
>
> Jeff
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to