[Prev][Next][Index]

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


Follow-Up(s):