]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Silence two "unused function af_lookup" warnings (#5222)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 4 Feb 2017 15:25:20 +0000 (10:25 -0500)
committerGitHub <noreply@github.com>
Sat, 4 Feb 2017 15:25:20 +0000 (10:25 -0500)
Gcc7 is smarter about detecting unused functions and detects those two functions
which are unused in tests. But gperf generates them for us, so let's instead of removing
tell gcc that we know they might be unused in the test code.

In file included from ../src/test/test-af-list.c:29:0:
./src/basic/af-from-name.h:140:1: warning: ‘lookup_af’ defined but not used [-Wunused-function]
 lookup_af (register const char *str, register size_t len)
 ^~~~~~~~~
In file included from ../src/test/test-arphrd-list.c:29:0:
./src/basic/arphrd-from-name.h:125:1: warning: ‘lookup_arphrd’ defined but not used [-Wunused-function]
 lookup_arphrd (register const char *str, register size_t len)
 ^~~~~~~~~~~~~

src/test/test-af-list.c
src/test/test-arphrd-list.c

index e2479133de78c246354e6c4609fad11af6080f66..e5ca54c8e7873a169692e3e89f7a6e0d07d463ce 100644 (file)
@@ -24,6 +24,7 @@
 #include "string-util.h"
 #include "util.h"
 
+_unused_ \
 static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len);
 
 #include "af-from-name.h"
index 8f4f342faabaaf355b50dfae3866bdad19006e81..bb51518c9c140684a4e57743d83de8f8983914f0 100644 (file)
@@ -24,6 +24,7 @@
 #include "string-util.h"
 #include "util.h"
 
+_unused_ \
 static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
 
 #include "arphrd-from-name.h"