lclint-interest message 156

From kir@iitb.fhg.de Mon Sep 22 15:27:25 1997
X-Env: (mailgw1.fhg.de) kir@iitb.fhg.de -> lclint-interest@larch.lcs.mit.EDU.VIA-SMTP
Date: Mon, 22 Sep 1997 16:43:09 +0200
From: kir@iitb.fhg.de (Harald Kirsch)
To: lclint-interest@larch.lcs.mit.edu
Subject: How to annotate


Again I am having trouble with annotating some code. Please have a look
at that:

------------------------------------------------------------------------
int
main(void)
{
  float f;
  int i=19;

  if( i>0 ) {
    f = 1.0;
  } 

  if( i>0 ) {
    float g = f;	/***** Variable f used before definition */
  }

  return 0;
}
------------------------------------------------------------------------

I understand that the case is for lclint not as trivial as it may appear
to us. It has to prove that the value of `i' does not change between the
two if-statements.

However, I thought lclint does some data-flow analysis and I cannot
decide, if it should know that `f' is defined at the place where it
gives the error.

	Regards,
	Harald.

-------------------------------------------------+------------------
Harald Kirsch, kir@iitb.fhg.de, +49 721 6091 369 | Now I rebooted.
FhG/IITB,      Fraunhoferstr.1, 76131 Karlsruhe  |     --- Jerry Pournelle


Previous Message Next Message Archive Summary LCLint Home Page David Evans
University of Virginia, Computer Science
evans@cs.virginia.edu