Click on image to see enlargment
In computing the average wind velocity for a cold windy March day, the result, instead of being above 10 was below 1. What's the problem?
bug627.cpp lint Output
--- Module: bug627.cpp (C++) _ sscanf( a[i], "%s %d", direction, &vel ); bug627.cpp(12) : Warning 627: (arg. no. 4) indirect object inconsistent with format _ return sum / i; bug627.cpp(15) : Info 795: Conceivable division by 0 [Reference: file bug627.cpp: line 11] _ } bug627.cpp(16) : Info 818: Pointer parameter 'a' (line 6) could be declared as pointing to const
Reference Manual Explanation
627 (arg. no. Integer) indirect object inconsistent with format -- The type of an argument to scanf (or fscanf or sscanf) was inappropriate to the format. However, the argument was a pointer and it pointed to a quantity of the expected size.
If you have comments or questions about this bug, please post them to our Discussion Forum
Previous Bug - Bug #1511 - February 2006