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-03 23:13:11

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>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/3439595d5b85f0af565f5a58e495d885537fb227

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