On 1 May 2006 08:32:47 -0700, "FBM" <fb******@gmail.com> wrote:
Thanks.. it's working, but i get this nasty warning..
STATS mySTATS[10] = { 0 };
gcc -DMEMWATCH -O0 -g3 -Wall -c -fmessage-length=0 -omain.o ../main.c
../main.c: In function 'main':
../main.c:44: warning: missing braces around initializer
../main.c:44: warning: (near initialization for 'mySTATS[0]')
Finished building: ../main.c
You probably need {{0}}. The outer set of braces denotes
initialization data. The inner set indicates it applies to the first
element of the array (mySTATS[0]). Since there are less initializers
than members of mySTATS[0], the first member is initialized explicitly
and the remaining members are set to the appropriate form of 0
implicitly. Since there are less array initializers than elements of
the array, the remaining array elements are initialized to 0
implicitly.
Many implementations would accept your code and I don't know if the
standard *requires* the second set of braces. It could be
over-exuberance on the part of gcc. Compilers are allowed to generate
"extraneous" diagnostics for anything they don't like as long as they
generate the correct code. (I'm waiting for one that complains the
indenting style is unreadable for some of the code posted here.)
Remove del for email