ma**********@thales-is.com writes:
Running lint on code initialising a local 2-D array gives a warning.
void f(void)
{
int a[5][3] = { 0 };
...
lint gives "warning: Partially elided initialisation..."
Should this be happening, and what does it mean (the warning does not
occur for 1-D array)?
[Running "lint -std1 -u -x a.c" on Tru64 platform]
"{ 0 }" is a perfectly good way to specify initializing something to
all zeros. (Note: it specifies logical zero values for each
component, not necessarily all-bits-zero; pointers will be set to
null, and floating-point numbers to 0.0.)
On the other hand, a C implementation is free to issue any diagnostics
it likes, for any reason:
warning: No errors detected on this line
warning: Danger, Will Robinson!
And lint isn't even a C implementation.
You might complain to the authors of your particular lint about the
warning for this correct and idiomatic construct, but there's no
conformance issue.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.