[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#915405: gcc-8: Spurious stringop-overflow error when compiling with -O2



Control: forwarded -1 https://gcc.gnu.org/PR87296
Control: tags -1 - moreinfo
Control: tags -1 + upstream

On 05.12.18 09:12, François Trahay wrote:
> #include <string.h>
> #include <stdlib.h>
> 
> char* copy_string(const char* str) {
>   int len = strlen(str);
>   char* dest = malloc(sizeof(char)*len+1);
>   strncpy(dest, str, len+1);
>   return dest;
> }


Reply to: