lclint-interest message 181

From Tue Jan  6 19:15:46 1998
Date: Tue, 6 Jan 98 18:57:29 -0500
From: (David Evans)
In-Reply-To: David A Vincent's message of 07 Jan 1998 10:30:06 +1100 
Subject: annotation help

When you redeclare something, lclint will use the later definition
(after warning you about the redeclartion and inconsistencies).  So,
after you added the declaration with the /*@null@*/ annotation, you
shouldn't get messages where XtAddCallback is called with a possibly
null XtPointer argument.  

There's no special syntax to indicate that you are augmenting an earlier
definition, but you can use syntactic comments to suppress the
inconsistent declaration message (as suggested by the error message you
got).  For example,

/*@external@*/ extern void XtAddCallback(Widget, String,
                                         XtCallbackProc, /*@null@*/ XtPointer);

I added the /*@external@*/ to indicate that the definition of
XtAddCallback is in an external file, so if you do completeness checking
you wouldn't get complaints about it not being defined.

--- Dave

Previous Message Next Message Archive Summary LCLint Home Page David Evans
University of Virginia, Computer Science