Thread (3 messages) flat view 3 messages, 2 authors, 2019-10-11

Re: [PATCH] selftests/powerpc: Fix compiling error on tlbie_test due to newer gcc

From: Michael Ellerman <hidden>
Date: 2019-10-11 08:28:50

On Thu, 2019-10-03 at 21:10:10 UTC, "Desnes A. Nunes do Rosario" wrote:
Newer versions of GCC demand that the size of the string to be copied must
be explicitly smaller than the size of the destination. Thus, the NULL
char has to be taken into account on strncpy.

This will avoid the following compiling error:

  tlbie_test.c: In function 'main':
  tlbie_test.c:639:4: error: 'strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation]
      strncpy(logdir, optarg, LOGDIR_NAME_SIZE);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Signed-off-by: Desnes A. Nunes do Rosario <redacted>
Reapplied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/5b216ea1c40cf06eead15054c70e238c9bd4729e

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help