|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home Page bug534.cpp
Will the programmer print the length of the 3rd line of file test.txt or can something go wrong?
bug534.cpp lint Output
--- Module: bug534.cpp
_
if( (f = fopen( filename, "r" )) )
bug534.cpp(9) : Info 720: Boolean test of assignment
_
for( j = 0; j < n; j++ ) fgets( buf, 200, f );
bug534.cpp(11) : Warning 534: Ignoring return value of function 'fgets(char *,
int, struct _iobuf *)' (compare with line 300, file C:\program
files\microsoft visual studio\vc98\include\stdio.h)
_
for( i = 0; buf[i]; i++ ) /* find end of buf */;
bug534.cpp(12) : Info 771: Symbol 'buf' (line 7) conceivably not initialized
Reference Manual Explanation
534 Ignoring return value of Symbol (compare with Location) -- A
function that returns a value is called just for side effects as,
for example, in a statement by itself or the left-hand side of a
comma operator. Try: (void) function(); to call a function and
ignore its return value. See also the fvr, fvo and fdr flags.
|
Previous Bug - Bug #1747 - March 2001