[lkml]   [2018]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: linux-next: build warnings from Linus' tree
On Mon, Aug 20, 2018 at 03:33:19AM +0200, Adam Borowski wrote:
> Valid uses of strncpy() do exist (such as SCSI structs), but those deal with
> fixed-width fields. Thus, gcc is right for warning for at least some of
> misuse of strncpy() for C strings. The function wasn't designed for them.

The problem is that the kernel has a goodly share of fixed-width
fields. The ext4 superblock is one of them. strncpy() is the most
convenient function to do what is needed. If it's a valid use, then
we need to have a way to get gcc to shut up about them.

- Ted

 \ /
  Last update: 2018-08-20 04:55    [W:0.055 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site