- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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); // **** }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just saw a post from Robyn Weil, you may email the bug-report directly to her: rbyn at cypress dot com.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not see where you have declared "usbCmdBuffer" anywhere. Did a
search of your entire workspace, still not found.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've turned this into the developers but haven't heard anything back yet. I'll let you know when I do. -Robyn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.