lclint-interest message 35

From: Jon Freeman 
Date: Mon, 19 Jun 1995 08:57:35 -0400
To: lclint-interest@larch.lcs.mit.edu
Subject: False alarms in lclint 1.4

The current version of lclint is falsely identifying unreachable code
in many of our routines.  Someone might want to correct this.

Our routines frequently have the following overall structure:

                int RandomRoutine( ... )
                {
                    static char routine[] = "RandomRoutine";

                    if( ...error condition 1... )
                        goto failed;
                    ...
                    if( ...error condition 2... )
                        goto failed;
                    ...

                    return SUCCESS;

                  failed:
                    RecordError( "%s:  Failed.\n", routine );
                    return FAILURE;
                }

The purpose of this structure is to create a stack of error messages
in the error log so that when an error occurs, we can trace it quickly
and easily.  The problem is that lclint always marks the code beneath
the "failed:" label as unreachable, even though this is clearly not
the case.

                        Thanks,
                         Jon

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