GCC8 (but apparently not later versions) complain about the use of
strncpy when not actually copying a string:
remote-utils.c:1140:14: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
strncpy (buf, "watch:", 6);
~~~~~~~~^~~~~~~~~~~~~~~~~~
This is "harmless" because buf is large enough and we will add more
chars (including a zero terminator) later. But using strncpy here is a
bit odd because we don't really want to copy a string, but an array of
6 chars. So use memcpy here to do so, simplyfing the code.
CORE_ADDR addr;
int i;
- strncpy (buf, "watch:", 6);
+ VG_(memcpy) (buf, "watch:", 6);
buf += 6;
addr = valgrind_stopped_data_address ();