[splint-discuss] How do I treat a symbol table?
Tommy Pettersson
ptp at lysator.liu.se
Wed Aug 24 12:15:56 EDT 2005
On Tue, Aug 23, 2005 at 11:49:27AM -0700, Terry Colligan wrote:
> > I looks like you aren't planning to release any of the memory
> > owned by the symbol table, since you add pointers to string
> > literals to it with no special markings.
>
> That's currently true, but I could add two routines -- one
> for static string literals, and one for malloc'd strings.
Ok. Then the problem will be that splint is made for static
checking of the source, but the symbol table will have pointers
of two different types (as splint sees it: owners and observers)
that are only known at run time. It doesn't mean splint will be
useless, but you'll have to expect splint to not handle some
parts of the code and generate irrelevant warnings.
> I need an annotation-based solution, rather than a flag-based
> solution, because I don't want to lose the checking for other
> dynamically-allocated pointers.
You can control the flags with splint comments in the source
code (section 1.3.2 in the manual). Example:
/*@-some_flag +some_other_flag@*/
some code;
/*@=some_flag =some_other_flag@*/
--
Tommy Pettersson <ptp at lysator.liu.se>
More information about the splint-discuss
mailing list