Hello,

I noticed several warings while compiling haproxy with clang (from
FreeBSD 9.1 base system).

* 145 unused-value regarding mini-clist.h (LIST_ADD, LIST_ADDQ,
LIST_DEL) and standard.h (UBOUND

src/haproxy.c:1206:4: warning: expression result unused [-Wunused-value]
                        LIST_DEL(&log->list);
                        ^~~~~~~~~~~~~~~~~~~~
include/common/mini-clist.h:117:95: note: expanded from macro 'LIST_DEL'
...({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n =
(el)->n; (__ret); })

       ^~~~~
The patch mute then by casting the return value to (void) as we can
expect further usage of those values.

* 14 empty-body regarding a gcc warning fix

src/haproxy.c:1532:73: warning: if statement has empty body [-Wempty-body]
                                if (write(pidfd, pidstr,
strlen(pidstr)) < 0) /* shut gcc warning */;

                             ^
src/haproxy.c:1532:73: note: put the semicolon on a separate line to
silence this warning [-Wempty-body]

The patch just apply clang recommendation " put the semicolon on a
separate line to silence this warning " (adding a hack to another).


As they are quite long, patches are attached.

Best regards
Joris

Attachment: clang-unused-value.patch
Description: Binary data

Attachment: clang-empty-body.patch
Description: Binary data

Reply via email to