[cfe-commits] RangeConstraintManager

Ted Kremenek kremenek at apple.com
Fri Feb 13 10:57:59 PST 2009


On Feb 13, 2009, at 9:01 AM, Ben Laurie wrote:

>>>
>>> class RangeSet {
>>> PrimRangeSet ranges; // no need to make const, since it is an
>>>                      // ImmutableSet - this allows default operator=
>>>                      // to work.
>>> bool noValues;  // if true, no value is possible (should never  
>>> happen)
>>> static PrimRangeSet::Factory factory;
>>
>> Please don't use a static member variable.  I see this as the same  
>> vice as
>> using a global variable.
>
> Hmmph. Singletons?

Right, singletons aren't necessarily a bad idea, but they are in this  
context.  State associated with RangeConstraintManager shouldn't exist  
beyond its lifetime.  This restriction allows the analyzer to be used  
more likely a library than a standalone tool.



More information about the cfe-commits mailing list