]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix warnings when using two unusual options together.
authorNick Mathewson <nickm@torproject.org>
Tue, 22 Sep 2020 13:59:37 +0000 (09:59 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Sep 2020 14:07:14 +0000 (10:07 -0400)
The option `--enable-all-bugs-are-fatal` when used with
`--disable-module-relay` caused GCC to warn about functions that
it thought should be labeled noreturn.

I've tried a couple of approaches, but disabling the warning on
these functions seems to be the best approach.

Fixed #40129; bugfix on 0.4.4.1-alpha.

changes/bug40129 [new file with mode: 0644]
src/feature/dircache/dircache_stub.c
src/feature/relay/router.c

diff --git a/changes/bug40129 b/changes/bug40129
new file mode 100644 (file)
index 0000000..80de5ef
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+    - Fix compiler warnings that would occur when building with
+      "--enable-all-bugs-are-fatal" and "--disable-module-relay"
+      at the same time. Fixes bug 40129; bugfix on 0.4.4.1-alpha.
index 87811597d1726b71a5cf1f91546573561078f4d6..725c44bd4dbf7e3dcd9ce74a43bb771c1aacb02c 100644 (file)
@@ -14,6 +14,7 @@
 #include "feature/dircache/dirserv.h"
 #include "feature/dircommon/dir_connection_st.h"
 
+DISABLE_GCC_WARNING("-Wmissing-noreturn")
 int
 directory_handle_command(dir_connection_t *conn)
 {
@@ -29,6 +30,7 @@ connection_dirserv_flushed_some(dir_connection_t *conn)
   tor_assert_nonfatal_unreached_once();
   return -1;
 }
+ENABLE_GCC_WARNING("-Wmissing-noreturn")
 
 void
 dir_conn_clear_spool(dir_connection_t *conn)
index 34d8163c361df3b4d6ed2d4cf74072f892fd0c82..75a3d2f35c514840c11d0e8db3df810c216b3913 100644 (file)
@@ -2488,6 +2488,10 @@ check_descriptor_bandwidth_changed(time_t now)
   }
 }
 
+// This function can be "noreturn" if relay mode is disabled and
+// ALL_BUGS_ARE_FATAL is set.
+DISABLE_GCC_WARNING("-Wmissing-noreturn")
+
 /** Note at log level severity that our best guess of address has changed from
  * <b>prev</b> to <b>cur</b>. */
 void
@@ -2517,6 +2521,7 @@ log_addr_has_changed(int severity,
              "Guessed our IP address as %s (source: %s).",
              addrbuf_cur, source);
 }
+ENABLE_GCC_WARNING("-Wmissing-noreturn")
 
 /** Check whether our own address as defined by the Address configuration
  * has changed. This is for routers that get their address from a service