-Wall dnl
-Wnull-dereference dnl
-Wundef dnl
+ -Wlogical-op dnl
dnl We currently get this warning when building with Clang:
dnl
dnl /usr/include/setjmp.h:54:12: error: declaration of built-in function '__sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header <setjmp.h>. [-Werror,-Wincomplete-setjmp-declaration]
reception_buffer->data + state->received,
state->left_to_receive, MSG_DONTWAIT);
if (ret < 0) {
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ DIAGNOSTIC_POP
PERROR("Unable to receive command payload on sock %d",
conn->sock->fd);
status = RELAY_CONNECTION_STATUS_ERROR;
reception_buffer->data + state->received,
state->left_to_receive, MSG_DONTWAIT);
if (ret < 0) {
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ DIAGNOSTIC_POP
PERROR("Unable to receive control command header on sock %d",
conn->sock->fd);
status = RELAY_CONNECTION_STATUS_ERROR;
state->header_reception_buffer + state->received,
state->left_to_receive, MSG_DONTWAIT);
if (ret < 0) {
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ DIAGNOSTIC_POP
PERROR("Unable to receive data header on sock %d", conn->sock->fd);
status = RELAY_CONNECTION_STATUS_ERROR;
}
ret = conn->sock->ops->recvmsg(conn->sock, data_buffer,
recv_size, MSG_DONTWAIT);
if (ret < 0) {
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ DIAGNOSTIC_POP
PERROR("Socket %d error", conn->sock->fd);
status = RELAY_CONNECTION_STATUS_ERROR;
}
* the job will be processed when the rotation_thread catches
* up.
*/
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ DIAGNOSTIC_POP
/*
* Not an error, but would be surprising and indicate
* that the rotation thread can't keep up with the
# define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT
# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
+# define DIAGNOSTIC_IGNORE_LOGICAL_OP
#else
/* GCC */
# define DIAGNOSTIC_IGNORE_SUGGEST_ATTRIBUTE_FORMAT \
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=format\"")
# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
+# define DIAGNOSTIC_IGNORE_LOGICAL_OP \
+ _Pragma("GCC diagnostic ignored \"-Wlogical-op\"")
#endif
/* Used to make specific C++ functions to C code. */
/*
* We consider EPIPE and EAGAIN/EWOULDBLOCK as expected.
*/
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EPIPE) {
+ DIAGNOSTIC_POP
/*
* Nothing was recv.
*/
/*
* We consider EPIPE and EAGAIN/EWOULDBLOCK as expected.
*/
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EPIPE) {
+ DIAGNOSTIC_POP
/*
* This can happen in non blocking mode.
* Nothing was sent.
/*
* We consider EPIPE and EAGAIN/EWOULDBLOCK as expected.
*/
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ DIAGNOSTIC_POP
/*
* This can happen in non blocking mode.
* Nothing was sent.
/*
* We consider EPIPE and EAGAIN/EWOULDBLOCK as expected.
*/
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_LOGICAL_OP
if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ DIAGNOSTIC_POP
/*
* This can happen in non blocking mode.
* Nothing was recv.