Function result ignored

A subroutine that returns a value was called but the result was ignored.

This could indicate loss of information or failure to check an error code. If this is the desired effect, then the error can be suppressed in C by inserting a typecast to "void."

This same kind of error can also happen when a FORTRAN dummy argument of type subroutine is invoked. That is, the subroutine that is invoked through a dummy argument might exhibit the same problem as can occur in a direct call. In this case, the problem may or may not happen depending on what subroutine was passed to the dummy argument of subroutine type. There will be an additional observation in such cases that identifies the call site where the subroutine argument was passed in.

ID

Observation

Description

1

Call site

The place the function was called

Example

          
extern int f();

int main(int argc, char **argv) 
{
    f(); // ignores integer return value
    (void)f(); // error won't be flagged on this call
}
        

Copyright © 2010, Intel Corporation. All rights reserved.