We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I'm trying to implement a code which copies a part of a string which is pointed to by a char (*outr_message), and adds it to an unsigned-char (UART1_error_format).
For example: if *outr_message is "e97" so UART1_error_format will be err97.
the current code is:
void Serial_Output_Full_Reset(char *outr_message) { unsigned char UART1_error_format[5] = "err"; //prepare the message set_message_in_transbuffer(String_Message, outr_message, NULL, NULL, 0, 0); #if __RS485__ if (&outr_message[1] == 'e') // converting 'eXX' to 'errXX' { strncpy(UART1_error_format, outr_message + 2, 2); UART1_error_format[5] = '\0'; random_write(0 ,0 , nooutr, UART1_error_format, 2); } #endif }
after compiling there's an error appearing:
new_meas_proc.c(52): warning C214: 'Argument': conversion: pointer to non-pointer
I've tried several ways to fix the warning, which is connected to the strncpy function I believe, since I've entered to the function 'random_write' correct variables types:
void random_write(float Treal, float Emiss, unsigned char Outr,unsigned char Err, unsigned char Scale);
What should be done to fix the warning? is a conversion from char to unsigned char also needed? Thanks much, Amitai pointers are quite confusing...