------- Comment #1 from madcoder at debian dot org  2007-05-10 11:12 -------
It seems that even if the argument is declared const foo_t * gcc assumes the
function will initialize the data, which is rather ... erm... strange. Here is
the testcase:

======================================================
struct foo { int toto; };

void do_bar(const struct foo *);

int main(void) {
    struct foo foo;
    do_bar(&foo);
    return 0;
}
======================================================

gcc -Wall -Wextra -O2 -Wuninitialized -c -o foo.o foo.c

gives no warning while I'd expect to have one as do_bar takes a const foo_t *
hence should not initialize it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31893

Reply via email to