cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

New Contributor II

 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
Reply
5 Replies
Esteemed Contributor II

Seems to be a bug in strings.h. When I replace toupper with a self-written function no warning is flagged.

   

Best will be  to file a Mycase.

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor II

Just saw a post from Robyn Weil, you may email the bug-report directly to her: rbyn at cypress dot com.

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor

I do not see where you have declared "usbCmdBuffer" anywhere. Did a

   

search of your entire workspace, still not found.

   

 

   

Regards, Dana.

0 Likes
Reply
Employee

 I've turned this into the developers but haven't heard anything back yet. I'll let you know when I do. -Robyn

0 Likes
Reply
New Contributor II

 Thanks Bob and Robyn

   

The dfinition of usbCmdBuffer isn't important, since it's the sub-script type it is warning about.

   

I think Bob has found it with the definition of toupper in strings.h

   

I'll dig a bit deeper from this end too.

   

 

   

Thanks again.

0 Likes
Reply