[lkml]   [2018]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Support the nonstring variable attribute (gcc >= 8)
On Sat, 17 Feb 2018, Miguel Ojeda wrote:

> From the GCC manual:
> The nonstring variable attribute specifies that an object or member
> declaration with type array of char or pointer to char is intended to
> store character arrays that do not necessarily contain a terminating NUL
> character. This is useful in detecting uses of such arrays or pointers
> with functions that expect NUL-terminated strings, and to avoid warnings
> when such an array or pointer is used as an argument to a bounded string
> manipulation function such as strncpy.
> Some reports are already coming to the LKML regarding these
> warnings. When they are false positives, we can use __nonstring to let
> gcc know a NUL character is not required; like in this case:
> Signed-off-by: Miguel Ojeda <>
> Cc: Ingo Molnar <>
> Cc: Josh Poimboeuf <>
> Cc: Kees Cook <>
> Cc: Andrew Morton <>
> Cc: Geert Uytterhoeven <>
> Cc: Will Deacon <>
> Cc: Greg Kroah-Hartman <>
> Cc: David Rientjes <>

I would have expected to have seen __nonstring used somewhere as part of
this patch.

 \ /
  Last update: 2018-02-19 00:21    [W:0.127 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site