Skip to content

warning: array subscript has type ‘char’ [-Wchar-subscripts] #7

@denisdemaisbr

Description

@denisdemaisbr

cc -Wall -std=c11 -o pixd pixd.c

In file included from pixd.c:2:
pixd.c: In function ‘parse_range’:
pixd.c:101:18: warning: array subscript has type ‘char’ [-Wchar-subscripts]
101 | if (!isdigit(*first) || end != delim) errx(1, "invalid start value in range %s", str);
| ^~~~~~
pixd.c:105:18: warning: array subscript has type ‘char’ [-Wchar-subscripts]
105 | if (!isdigit(*second) || *end != '\0') errx(1, "invalid end/size value in range %s", str);

to fix:

101 | if (!isdigit( (unsigned char) *first) || end != delim) errx(1, "invalid start value in range %s", str);
105 | if (!isdigit( (unsigned char) *second) || *end != '\0') errx(1, "invalid end/size value in range %s", str);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions