Skip to content

-Werror problems on NetBSD #50

Closed
Closed

Description

@0-wiz-0

watchman-2.9.8 doesn't compile with -Werror on NetBSD; however, -Werror is the default except if one passes --enable-lenient.

The following warnings need fixing:

root.c: In function 'consume_kqueue':
root.c:1837:36: warning: initialization makes pointer from integer without a cast [enabled by default]
       struct watchman_file *file = root->keventbuf[i].udata;
                                    ^
string.c: In function 'w_string_dup_lower':
string.c:102:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     if (tolower(str->buf[i]) != str->buf[i]) {
     ^
string.c:126:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     buf[i] = tolower(str->buf[i]);
     ^
string.c: In function 'w_string_new_lower':
string.c:154:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     buf[i] = tolower(str[i]);
     ^
string.c: In function 'w_string_equal_caseless':
string.c:202:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     if (tolower(a->buf[i]) != tolower(b->buf[i])) {
     ^
string.c:202:5: warning: array subscript has type 'char' [-Wchar-subscripts]
string.c: In function 'w_string_suffix_match':
string.c:240:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     if (tolower(str->buf[base + i]) != suffix->buf[i]) {
     ^
string.c: In function 'w_string_suffix':
string.c:267:9: warning: array subscript has type 'char' [-Wchar-subscripts]
         *buf = tolower(str->buf[end]);
         ^
thirdparty/tap.c: In function '_gen_result':
thirdparty/tap.c:94:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     if(!isdigit(*c) && !isspace(*c)) {
     ^
thirdparty/tap.c:94:5: warning: array subscript has type 'char' [-Wchar-subscripts]
query/suffix.c: In function 'suffix_parser':
query/suffix.c:44:5: warning: array subscript has type 'char' [-Wchar-subscripts]
     arg[i] = tolower(arg[i]);
     ^
tests/bser.c: In function 'hexdump':
tests/bser.c:34:7: warning: array subscript has type 'char' [-Wchar-subscripts]
       printf("%c", isprint(start[i]) ? start[i] : '.');
       ^

See the CAVEATS section in
http://netbsd.gw.com/cgi-bin/man-cgi?ctype+3+NetBSD-current
for an explanation what the problem with "type 'char'" is.

Activity

  1. wez commented on Aug 10, 2014

    @wez
    Contributor

    We don't have a NetBSD system handy to try this out and verify it.
    Can you repeat this against master and submit a pull request with the obvious casts?
    Thanks!

  2. 0-wiz-0 commented on Aug 10, 2014

    @0-wiz-0
    ContributorAuthor

    Thanks for the feedback. I've added casts and submitted PR #51.
    (There is a travis issue on the mac system, but it doesn't look related to the actual patch.)

  3. wez commented on Aug 10, 2014

    @wez
    Contributor

    Thanks; we've had issues with Travis and I've just pushed a commit that I hope will clear this state.
    I'll close this issue in favor of #51

  4. added a commit that references this issue on Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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