|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCHv3 24/25] nolibc: Clear a -Wstringop-overflow warning for strncpy
Hello Wei Chen, Please find my comments inline. Thanks & Regards Sharan On 12/13/18 10:15 AM, Wei Chen wrote: The strncpy needs a signed integer for 3rd parameter, but the SIZE_MAX is unsigned integer. We will get following error: /lib/nolibc/string.c:155:9: warning: ‘strncpy’: specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] return strncpy(dst, src, SIZE_MAX); [1] show the posix standard function declaration strncpy using size_t[2] as the third parameter. The upstream code seems to be correct. I am not sure if we need this patch.
[1] http://pubs.opengroup.org/onlinepubs/009696899/functions/strncpy.html [2] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |