Ehren,

> -----Original Message-----
> From: Ehren Metcalfe [mailto:[email protected]]
> Sent: Tuesday, July 13, 2010 2:58 AM
> To: Bartlett, Roscoe A
> Cc: [email protected]; Allan, Benjamin
> Subject: Re: Dehydra support for pragmas or other ways to turn on and
> off checking?
> 
> Unfortunately you're not going to be able to use global variables to
> turn analysis on and off at the file scope because dehydra doesn't
> have a callback to see these (you'd need to use treehydra instead).
> You also won't be able to rely on on any particular order when
> visiting declarations so if you did go this route you'd have to save
> up all of your errors and then examine line numbers to determine if
> checking is enabled (the horror). Actually this situation does call
> for some kind of pragma support but that won't be implemented in the
> immediate future. If it's really necessary feel free to file a bug in
> mozilla's rewriting and analysis section.
> 
> My suggestion would be to use function attributes to turn checking
> on/off at the whole function level. You could also enable/disable
> checking for all methods of a class using type attributes.

[Bartlett, Roscoe A] 

Darn, I guess I will not be able to turn on and off checking at the scope that 
I would have liked.  However, controlling checking at the class and function 
level with user-defined attributes is not the end of the world either.

> For
> function scope enabling/disabling of checking I would go with a simple
> inline function call but the variable declarations would work too.
> Check out http://mxr.mozilla.org/mozilla-
> central/source/xpcom/base/nscore.h#490
> for how this is managed in the mozilla build system. We hide the
> attributes behind macros and ifdef them as no ops when static checking
> is not enabled.

[Bartlett, Roscoe A] 

Are the declarations within a given function guaranteed to be processed in the 
order that they appear in the source file?

> As to long term maintenance, I believe dehydra builds out of the box
> with gcc trunk so support in a future gcc 4.6 release should be a
> given. Beyond that, I'm not really the one to ask but I don't see why
> it would be unsupported.

[Bartlett, Roscoe A] 

Who would I ask about long term support for Dehydra in GCC?   I guess that 
Mozilla has made a sizable investment in Dehydra so I would guess that it is 
Mozilla that is on the hook for keeping up with GCC changes?

Thanks for your comments.  They could have saved me a whole bunch of wasted 
time going down the wrong path to start with.

Cheers,

- Ross


_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis

Reply via email to