Benjamin Smedberg wrote:
On 4/3/09 6:58 AM, Pavol Misik wrote:
I'm not good at makefiles and Moziila Build system.
How can I add _/analyze_ to build all c++ files with?
Without annotations, what will -analyze do?
I assume, when I build Mozilla with MS Visual C++ compiler it is used
Microsoft CRT.
Is it right?
MS CRT and Vista SDK are decorated with annotations.
Therefore it can point out to wrong use of these functions.
Example (xpcom\typelib\xpidl\xpidl_java.c):
In extreme conditions if malloc [buffer = malloc(sizeof(deprecated)+2);]
fail, then code [buffer[0] = '/';] cause crash. MS static analyze can
point out of this issue and other too.
static GSList*
add_deprecated(GSList *comments)
{
GSList *last;
char *buffer;
char *replaced;
const char deprecated[] = "* @deprecated */";
/* Handle the easy case: no documentation. */
if (comments == NULL) {
buffer = malloc(sizeof(deprecated)+2);
buffer[0] = '/';
buffer[1] = '*';
strcpy(buffer+2, deprecated);
return g_slist_append(comments, buffer);
}
PM-
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis