https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87028
--- Comment #3 from anon63 <anon63 at protonmail dot com> --- Dear Martin, Thank you for the explanations. Do you have any advice of what we should do before this eventual deferring of the strncpy -> memcpy folding in a future gcc release ? In particular, can you elaborate just a bit on what you said in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84474 : "strncpy is being misused and strcpy (or other string functions if strcpy is not acceptable) would be more appropriate" I am searching for a strategic way of dealing with these false positive when lots of codebases are going to be compiled by default with gcc-8. (as you know, gcc 8 is the default on debian sid since end of July 2018 but people are coming back from holidays now :) ) For example, here https://lkml.org/lkml/2018/2/17/198, a guy suggests to use -Wno-stringop-truncation until gcc deals true/false positive correctly or here https://stackoverflow.com/questions/50198319/gcc-8-wstringop-truncation-what-is-the-good-practice the pragma diagnostic solution, the manual strncmp->memcmp solution... Best,