diff options
author | Thomas Haller <thaller@redhat.com> | 2014-10-29 21:29:58 +0100 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-11-06 09:58:47 -0600 |
commit | 288cc20db30a1e3b80ecc2e7802719aea6f44d47 (patch) | |
tree | 9ae8113af78f2cfdfa46666e5aede994778d457a | |
parent | 7c891ae79d7b83fb1d8853c004227c11ab3a531e (diff) | |
download | NetworkManager-288cc20db30a1e3b80ecc2e7802719aea6f44d47.tar.gz |
dhcp: fix compiler warning in IN_SET macro
clang warns:
dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c:120:24: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
assert_return (IN_SET(client->state, DHCP_STATE_INIT,
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:376:17: note: expanded from macro 'IN_SET'
const typeof(_y) _x = (x); \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:238:34: note: expanded from macro 'assert_return'
if (_unlikely_(!(expr))) { \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:42:44: note: expanded from macro '_unlikely_'
#define _unlikely_(x) (__builtin_expect(!!(x),0))
^
dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c:120:24: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:379:47: note: expanded from macro 'IN_SET'
for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_ARGS__ })/sizeof(const typeof(_x)); _i++) \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:238:34: note: expanded from macro 'assert_return'
if (_unlikely_(!(expr))) { \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:42:44: note: expanded from macro '_unlikely_'
#define _unlikely_(x) (__builtin_expect(!!(x),0))
^
dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c:120:24: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:379:91: note: expanded from macro 'IN_SET'
for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_ARGS__ })/sizeof(const typeof(_x)); _i++) \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:238:34: note: expanded from macro 'assert_return'
if (_unlikely_(!(expr))) { \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:42:44: note: expanded from macro '_unlikely_'
#define _unlikely_(x) (__builtin_expect(!!(x),0))
^
dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c:120:24: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:380:31: note: expanded from macro 'IN_SET'
if (((const typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:238:34: note: expanded from macro 'assert_return'
if (_unlikely_(!(expr))) { \
^
../src/dhcp-manager/systemd-dhcp/src/shared/macro.h:42:44: note: expanded from macro '_unlikely_'
#define _unlikely_(x) (__builtin_expect(!!(x),0))
^
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/dhcp-manager/systemd-dhcp/src/shared/macro.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dhcp-manager/systemd-dhcp/src/shared/macro.h b/src/dhcp-manager/systemd-dhcp/src/shared/macro.h index 9ee332c8df..ceef491268 100644 --- a/src/dhcp-manager/systemd-dhcp/src/shared/macro.h +++ b/src/dhcp-manager/systemd-dhcp/src/shared/macro.h @@ -373,11 +373,11 @@ do { \ #define IN_SET(x, y, ...) \ ({ \ const typeof(y) _y = (y); \ - const typeof(_y) _x = (x); \ + typeof(_y) _x = (x); \ unsigned _i; \ bool _found = false; \ - for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_ARGS__ })/sizeof(const typeof(_x)); _i++) \ - if (((const typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \ + for (_i = 0; _i < 1 + sizeof((typeof(_x)[]) { __VA_ARGS__ })/sizeof(typeof(_x)); _i++) \ + if (((typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \ _found = true; \ break; \ } \ |