Closed ericpassmore closed 2 years ago
Fix by casting to char *. Earlier confirmLabel
is defined as volatile char confirmLabel[32]
. So this cast will resolve the compiler warning.
strcpy((char *) confirmLable, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"));
In addition strcpy
isn't secure so we should use strlcpy
strlcpy((char *) confirmLable, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"),32);
src/main.c:196:10: warning: passing 'volatile char [32]' to parameter of type 'char ' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] strcpy(confirmLabel, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed")); ^
~~~ /usr/arm-none-eabi/include/string.h:38:32: note: passing argument to parameter here char strcpy (char __restrict, const char __restrict);