I will look at sparse whether it can capture this kind of mistake.
Masatake YAMATO
From: Ben Hutchings <redacted>
Date: Wed, 20 Mar 2013 17:32:59 +0000
On Wed, 2013-03-20 at 12:07 -0400, David Miller wrote:
quoted
From: Masatake YAMATO <redacted>
Date: Tue, 19 Mar 2013 20:47:27 +0900
quoted
Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.
Signed-off-by: Masatake YAMATO <redacted>
Applied, thanks.
Although I'm disappointed that the compiler doesn't say anything about
this in the assignment.
We're assigning "char[16] = STRING" and it doesn't say anything if the
final NULL char doesn't fit into the array.
Unfortunately the C standard says this is allowed. (Though the C++
standard says it's not!) That doesn't mean the compiler can't warn
about it, of course.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.