Unexpected warning: array subscript has type 'char' [-Wchar-subscripts]

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
kemic_264446
Level 4
Level 4
First like received

 The following piece of code give the error:

   

.\usb_uart.c:210:3: warning: array subscript has type 'char' [-Wchar-subscripts] at the line marked with "****", but as far as I can see the array subscript is int, not char.

   

 

   

 

   
 int i,len;  uint16 c,d;  uint32 ip,u32;  char r,s;  char *pC = 0;  //MSG_BUF *pMB;     // convert entire buffer to UCASE  for(i=0; i<usbRxPos; i++)  {  usbCmdBuffer = toupper(usbCmdBuffer); // ****  }   
0 Likes
5 Replies