INN commit: trunk (configure.ac innd/rc.c)
INN Commit
rra at isc.org
Fri Dec 29 05:32:04 UTC 2017
Date: Thursday, December 28, 2017 @ 21:32:03
Author: eagle
Revision: 10204
Enable -Wlogical-op
This requires some slightly odd code in one place, but the check
seems worth it.
Modified:
trunk/configure.ac
trunk/innd/rc.c
--------------+
configure.ac | 4 ++--
innd/rc.c | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
Modified: configure.ac
===================================================================
--- configure.ac 2017-12-29 05:05:15 UTC (rev 10203)
+++ configure.ac 2017-12-29 05:32:03 UTC (rev 10204)
@@ -723,7 +723,7 @@
dnl -D_FORTIFY_SOURCE=2 enables warn_unused_result attribute markings
dnl on glibc functions on Linux, as well as more object size checking,
dnl which catches a few more issues.
-dnl -Wswitch-enum, -Wfloat-equal, -Wlogical-op,
+dnl -Wswitch-enum, -Wfloat-equal,
dnl "-Wconversion -Wno-sign-conversion",
dnl -Wunreachable-code, -Wstack-protector, -Wdeclaration-after-statement
m4_foreach_w(
@@ -736,7 +736,7 @@
-Wtrampolines -Wshadow -Wpointer-arith -Wc99-c11-compat
-Wbad-function-cast -Wcast-align -Wwrite-strings
-Wdangling-else -Wdate-time
- -Wjump-misses-init -Wstrict-prototypes
+ -Wjump-misses-init -Wlogical-op -Wstrict-prototypes
-Wold-style-definition
-Wmissing-prototypes -Wmissing-declarations
-Wnormalized=nfc -Wrestrict -Wredundant-decls -Wnested-externs -Winline
Modified: innd/rc.c
===================================================================
--- innd/rc.c 2017-12-29 05:05:15 UTC (rev 10203)
+++ innd/rc.c 2017-12-29 05:32:03 UTC (rev 10204)
@@ -454,8 +454,10 @@
/* Get the connection. */
size = sizeof remote;
if ((fd = accept(cp->fd, (struct sockaddr *)&remote, &size)) < 0) {
- if (errno != EWOULDBLOCK && errno != EAGAIN)
- syslog(L_ERROR, "%s cant accept RCreader %m", LogName);
+ /* Avoid -Wlogical-op warnings if EWOULDBLOCK == EAGAIN. */
+ if (errno != EWOULDBLOCK)
+ if (errno != EAGAIN)
+ syslog(L_ERROR, "%s cant accept RCreader %m", LogName);
return;
}
More information about the inn-committers
mailing list