Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Portability issue on pebble #49

@wdoganowski

Description

@wdoganowski

I want to use json-parser on pebble, but I get compilation error:

json.c:49:4: error: array subscript has type 'char' [-Werror=char-subscripts]

Following comments on http://stackoverflow.com/questions/10186219/array-subscript-has-type-char I needed to cast the parameter on (unsigned char):

   if (isdigit((unsigned char)c))
      return c - '0';

I needed to repeat it in four places.

Is there any other solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions