Re: [PATCH] Use NULL instead of integer 0 in security/selinux/

From: Olaf Titz
Date: Mon Jul 12 2004 - 12:48:57 EST


> struct foo {
> int a;
> int b;
> };
>
> then sparse is perfectly happy with someone clearing out a struct foo
> like this:
>
> struct foo bar = { 0 };
>
> but then if someone changes struct foo to be
>
> struct foo {
> void *x;
> int a;
> int b;
> };
>
> sparse will complain about that initialization, and all of the fixes

It complains rather rightly. Think what happens if the original
initializer was
struct foo bar = { 1 };

This ambiguity may well be the main reason for the C99 initializer
syntax.

Olaf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/