daemon: Ignore -Wnull-dereference & -Wshift-overflow warnings.

One -Wnull-dereference warning is real: we deliberately cause a
segfault in one of the tests.

There is a -Wshift-overflow bug in a Gtk 2 header.

The others are the result of shortcomings in GCC.

In all cases we have to add GCC diagnostic overrides to ignore
the warnings when compiling with ./configure --enable-werror.
This commit is contained in:
Richard W.M. Jones
2016-07-24 10:47:07 +01:00
parent d0e263248d
commit a8e15ea924
6 changed files with 32 additions and 3 deletions

View File

@@ -122,8 +122,14 @@ receive_stdout (int s)
error (EXIT_FAILURE, errno, "recvmsg stdout fd");
cmptr = CMSG_FIRSTHDR (&msg);
if (cmptr == NULL)
if (cmptr == NULL) {
error (EXIT_FAILURE, errno, "didn't receive a stdout file descriptor");
/* Makes GCC happy. error() cannot be declared as noreturn, so
* GCC doesn't know that the subsequent dereference of cmptr isn't
* reachable when cmptr is NULL.
*/
abort ();
}
if (cmptr->cmsg_len != CMSG_LEN (sizeof (int)))
error (EXIT_FAILURE, 0, "cmsg_len != CMSG_LEN (sizeof (int))");
if (cmptr->cmsg_level != SOL_SOCKET)