|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home Page bug651.cpp
The programmer expected to print the value '2'. Instead he got '0'. How come?
bug651.cpp lint Output
--- Module: bug651.c
struct { int a[3], b; } w[] = { { 1, 2, 3 }, 2 };
^
bug651.c(3) : Warning 651: Potentially confusing initializer
struct { int a[3], b; } w[] = { { 1, 2, 3 }, 2 };
^
bug651.c(3) : Info 785: Too few initializers for aggregate
struct { int a[3], b; } w[] = { { 1, 2, 3 }, 2 };
^
bug651.c(3) : Info 785: Too few initializers for aggregate
struct { int a[3], b; } w[] = { { 1, 2, 3 }, 2 };
^
bug651.c(3) : Info 785: Too few initializers for aggregate
--- Wrap-up for Module: bug651.c
Info 754: local structure member 'a' (line 3, file bug651.c) not referenced
Reference Manual Explanation
651 Potentially confusing initializer -- An initializer for a
complex aggregate is being processed that contains some
subaggregates that are bracketed and some that are not.
ANSI recommends either "minimally bracketed" initializers
in which there are no interior braces or "fully bracketed"
initializers in which all interior aggregates are
bracketed.
|
Previous Bug - Bug #603 - September 2001