lclint-interest message 147

From kir@iitb.fhg.de Wed Sep 10 10:42:32 1997
X-Env: (mailgw2.fhg.de) kir@bsilx1.iitb.fhg.de -> lclint-interest@larch.lcs.mit.EDU.VIA-SMTP
Date: Wed, 10 Sep 1997 11:50:36 +0200
From: Harald Kirsch 
To: lclint-interest@larch.lcs.mit.edu, kir@iitb.fhg.de
Subject: proper annotation of arrays



Hi there,

>from the docs I find that arrays of pointers cannot be fully handled by
lclint. It seems to be particularly difficult to know the state of
array elements, i.e. whether they are dead, live, allocated etc.

The example shown below reports an error where `lines[i]' is passed to
`free'.
########################################################################
int
main(void)
{
  char **lines;
  size_t i, N;

  N = 10;
  lines = (char **)malloc(N*sizeof(*lines));
  if( NULL==lines ) exit(EXIT_FAILURE);
  for(i=0; i

Previous Message

Next Message

Archive Summary

LCLint Home Page
 David
Evans 
University of Virginia, Computer Science
evans@cs.virginia.edu