The latest revision of GCC 8.0 adds a -Wstringop-truncation option to detect common misuses of the strncpy and strncat functions that may truncate the copy and leave the result without a terminating nul character. In testing the implementation with GDB sources on x86_64 I found a few instances of the warning that are issued for what's safe but nevertheless not strictly intended uses of the functions (i.e., to create "bounded" non-nul-terminated copies of a string). I adjusted the warning to accept some but not all of these use cases. The attached patch shows the two instances of the warning that I had to suppress in GDB. In general, even though the checker handles some such cases, to avoid the warning, it's best to use strncpy only with a bound that reflects the size of the destination, never that of the source. Martin