Hello
why doesn't gcc (-Wall -Wuninitalized -O) detect
an uninialized variable passed by reference
decleared as <type> const *<name> ?
Do we need an attribute like (("initialized")) in the
function prototype to give gcc an hint to force
checking of uninitalized parameters ?
example
file foo.c:
--------- cut here
/*
gcc -Wall -Wuninitialized -O foo.c
*/
#include <stdio.h>
int foo(int const *p)
{
static int sum = 0;
sum += *p;
return sum;
}
int main(int argc, char **argv)
{
int k;
return printf("%d\n", foo(&k));
}
--------- cut here end of file foo.c
p.s. i know i could pass the variable by value
to get a warning of an uninitalized variable.
--
Sylvester Diehl
marco Systemanalyse und Entwicklung GmbH Tel +49 8131 5161 42
Hans-Böckler-Str. 2, D 85221 Dachau Fax +49 8131 5161 66
http://www.marco.de/ Email [EMAIL PROTECTED]