Re: [PATCH 2/3] blkid: fix missing entries in magic array initilizer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 That sounds like am error/warning message from any crappy static
 source code analyzer...

On Sun, Feb 27, 2011 at 01:05:10PM +0100, Sami Kerola wrote:
> @@ -465,6 +465,6 @@ const struct blkid_idinfo befs_idinfo =
>  							B_OS_NAME_LENGTH },
>  		{ .magic = "1SFB", .len = 4, .sboff = 0x200 +
>  							B_OS_NAME_LENGTH },
> -		{ NULL }
> +		{ END_MAGIC_ARRAY }

 
 Maybe I need a coffee, but it seems like a valid C code for me...

 C99, 6.7.8 Initialization
 ...
 If an object that has static storage duration is not initialized
 explicitly,  then:

 - if it has pointer type, it is initialized to a null pointer;
 - if it has arithmetic type, it is initialized to (positive or
   unsigned) zero;
 - if it is an aggregate, every member is initialized (recursively)
   according to these rules;
 - if it is a union, the first named member is initialized
   (recursively) according to these rules.


 So, why we need to initialize to zero all struct members in the global
 array?
 
    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux