[go: up one dir, main page]

Menu

#1171 util/fluxbox-remote.cc:76:32: error: ordered comparison between pointer and zero ('unsigned char *' and 'int') with Clang 9 on macOS High Sierra 10.13.4

v1.3.7
closed-out-of-date
nobody
5
2019-07-21
2018-03-31
No

Hello!

In macOS High Sierra, Version 10.13.4, the struct

typedef struct {
unsigned char *value;
Atom encoding;
int format;
unsigned long nitems;
} XTextProperty;

has a pointer so Clang (Apple LLVM version 9.1.0 (clang-902.0.39.1), Target: x86_64-apple-darwin17.5.0) complains:

/usr/bin/clang++ -DHAVE_CONFIG_H -I. -include ./config.h -I./src/FbTk -I/opt/local/include -pipe -Os -stdlib=libc++ -arch x86_64 -MT util/fluxbox_remote-fluxb\
ox-remote.o -MD -MP -MF util/.deps/fluxbox_remote-fluxbox-remote.Tpo -c -o util/fluxbox_remote-fluxbox-remote.o test -f 'util/fluxbox-remote.cc' || echo './'ut\
il/fluxbox-remote.cc
util/fluxbox-remote.cc:76:32: error: ordered comparison between pointer and zero ('unsigned char *' and 'int')
&& text_prop.value > 0
~~~~~~~~~~~~~~~ ^ ~
1 error generated.
make[2]: *** [util/fluxbox_remote-fluxbox-remote.o] Error 1

--

Greetings

Pete

Discussion

  • Peter Dyballa

    Peter Dyballa - 2018-03-31

    This patch seems to cure the failure:

    --- util/fluxbox-remote.cc~ 2015-02-08 11:44:45.000000000 +0100
    +++ util/fluxbox-remote.cc 2018-03-31 13:56:09.000000000 +0200
    @@ -73,7 +73,7 @@
    if (strcmp(cmd, "result") == 0) {
    XTextProperty text_prop;
    if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
    - && text_prop.value > 0
    + && text_prop.value != nullptr
    && text_prop.nitems > 0) {

             printf("%s", text_prop.value);
    

    --

    Pete

     
  • Mathias Gumz

    Mathias Gumz - 2019-07-21
    • status: open --> closed-out-of-date
     

Log in to post a comment.