Warn about initialization of a char array with a too long constant C string.
This patch adds new option -Winit-cstring to sparse.
With the option sparse can Warn about initialization of a char array
with a too long constant C string. If the size of the char array and
the length of the string is the same, there is no space for the last
nul char of the string in the array.
char s[3] = "abc";
If the array is used as just a byte array, not as C string, this
warning is just noise. However, if the array is passed to functions
dealing with C string like printf(%s) and strcmp, it may cause a
trouble.
Here is a example of such trouble:
http://www.spinics.net/lists/netdev/msg229765.html
http://www.spinics.net/lists/netdev/msg229870.html
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>