[ovs-discuss] [PATCH 1/2] Cleanup isdigit() warnings.

Justin Pettit jpettit at nicira.com
Tue Aug 25 17:58:32 UTC 2009


On Aug 25, 2009, at 9:48 AM, Ben Pfaff wrote:

> What warning does it give?

lib/dpif-netdev.c: In function 'name_to_dp_idx':
lib/dpif-netdev.c:159: warning: array subscript has type 'char'

> See C99 7.4 "Character handling <ctype.h>":
>
> 1    The header <ctype.h> declares several functions useful for  
> classifying and mapping
>     characters.166) In all cases the argument is an int, the value  
> of which shall be
>     representable as an unsigned char or shall equal the value of  
> the macro EOF. If the
>     argument has any other value, the behavior is undefined.


I was casting it based on the prototype shown in the isdigit() man  
page.  Thanks for the pointer to the C99 spec.  Should I go ahead and  
cast it to an unsigned char, then?

--Justin







More information about the discuss mailing list