warnings from use of ctype.h methods

Joel Sherrill joel.sherrill@oarcorp.com
Thu Mar 11 16:16:00 GMT 2010


Hi,

I was looking over the warnings and noticed
a number of these in our build logs (~60
per build):

warning: array subscript has type 'char'

Most, if not all, of these appear to be from
using ctype.h methods which is caused by
a missing (int) case in line 57 in ctype.h:

#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[(__c]))[(int)(__c)])

Changing this to the following resolved the
warnings.

#define __ctype_lookup(__c) 
((__ctype_ptr__+sizeof(""[(int)__c]))[(int)(__c)])

This is with newlib 1.18.0 with the current RTEMS
patch.

Does this cast need to be added?

-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the Newlib mailing list