knz / go-libedit

Go wrapper around the BSD libedit replacement to GNU readline
Apache License 2.0
6 stars 6 forks source link

compile warnings in src/c-libedit #24

Open RaduBerinde opened 1 year ago

RaduBerinde commented 1 year ago

The warnings below show up during the lint tests in CockroachDB, distracting from the actual error messages. Could we modify the source to fix them? Adding some casts might fix them.


INFO: From Compiling unix/src/c-libedit/search.c:
external/com_github_knz_go_libedit/unix/src/c-libedit/search.c: In function 'cv_csearch':
external/com_github_knz_go_libedit/unix/src/c-libedit/search.c:607:20: warning: pointer targets in passing argument 2 of 'el_wgetc' differ in signedness [-Wpointer-sign]
  607 |   if (el_wgetc(el, &ch) != 1)
      |                    ^~~
      |                    |
      |                    wint_t * {aka unsigned int *}
In file included from external/com_github_knz_go_libedit/unix/src/c-libedit/el.h:49,
                 from external/com_github_knz_go_libedit/unix/src/c-libedit/search.c:56:
external/com_github_knz_go_libedit/unix/src/c-libedit/histedit.h:267:28: note: expected 'wchar_t *' {aka 'int *'} but argument is of type 'wint_t *' {aka 'unsigned int *'}
  267 | int   el_wgetc(EditLine *, wchar_t *);
      |                            ^~~~~~~~~
INFO: From Compiling unix/src/c-libedit/common.c:
external/com_github_knz_go_libedit/unix/src/c-libedit/common.c: In function 'ed_quoted_insert':
external/com_github_knz_go_libedit/unix/src/c-libedit/common.c:371:21: warning: pointer targets in passing argument 2 of 'el_wgetc' differ in signedness [-Wpointer-sign]
  371 |  num = el_wgetc(el, &c);
      |                     ^~
      |                     |
      |                     wint_t * {aka unsigned int *}
In file included from external/com_github_knz_go_libedit/unix/src/c-libedit/el.h:49,
                 from external/com_github_knz_go_libedit/unix/src/c-libedit/common.c:50:
external/com_github_knz_go_libedit/unix/src/c-libedit/histedit.h:267:28: note: expected 'wchar_t *' {aka 'int *'} but argument is of type 'wint_t *' {aka 'unsigned int *'}
  267 | int   el_wgetc(EditLine *, wchar_t *);
      |                            ^~~~~~~~~
``
RaduBerinde commented 1 year ago

I see that we already maintain a set of patches that refresh.sh applies, so this should be easy to do?

knz commented 1 year ago

I believe this will be fixed by #25.