|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug785.cpp
The programmer expected numbits to report that there are six 1's in the integer 0x18F. Instead two different compilers returned a value of 2. What's the problem? bug785.cpp lint Output--- Module: bug785.cpp
_
int density[16] = { 0,1,2,2,1,2,2,3,1,2,2,3,2,3,4 };
bug785.cpp(6) : Info 785: Too few initializers for aggregate 'density'
Reference Manual Explanation
785 Too few initializers for aggregate -- The number of initializers in a
brace-enclosed initializer was less than the number of items in the
aggregate. Default initialization is taken. An exception is made with
the initializer {0}. This is given a separate message number in the
Elective Note category ( 943). It is normally considered to be simply a
stylized way of initializing all members to 0.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1752 - August 2004