Skip to content

Commit 5d8db15

Browse files
authored
ell: only include 'ell/ell.h' header (#309)
When looking at the code of other projects using ELL (IWD, BlueZ, Ofono), it looks like only 'ell.h' should be included, not individual header files from the 'ell' header directory. That looks like the way to go, because when looking at ell/genl.h, it uses functions declared in ell/netlink.h, without including this file before. This causes issues when compiling the code using libell-dev installed on the system: libtool: compile: gcc (...) -c path_manager.c (...) In file included from path_manager.c:21: /usr/include/ell/genl.h: In function 'l_genl_attr_next': /usr/include/ell/genl.h:98:16: error: implicit declaration of function 'l_netlink_attr_next'; did you mean 'l_genl_attr_next'? [-Wimplicit-function-declaration] 98 | return l_netlink_attr_next((struct l_netlink_attr *) attr, | ^~~~~~~~~~~~~~~~~~~ | l_genl_attr_next /usr/include/ell/genl.h: In function 'l_genl_attr_recurse': /usr/include/ell/genl.h:105:16: error: implicit declaration of function 'l_netlink_attr_recurse'; did you mean 'l_genl_attr_recurse'? [-Wimplicit-function-declaration] 105 | return l_netlink_attr_recurse((struct l_netlink_attr *) attr, | ^~~~~~~~~~~~~~~~~~~~~~ | l_genl_attr_recurse make[2]: *** [Makefile:597: libmptcpd_la-path_manager.lo] Error 1 All .c files including ELL header files have been modified to include only <ell/ell.h>. The .cpp file in the tests has not been modified, because it looks like that causes some issues. For the same reason, include/mptcpd/private/plugin.h file has not been modified as well. Closes: #302 Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 3702487 commit 5d8db15

31 files changed

+31
-183
lines changed

lib/hash_sockaddr.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
#include <string.h>
1717
#include <netinet/in.h>
1818

19-
#pragma GCC diagnostic push
20-
#pragma GCC diagnostic ignored "-Wpedantic"
21-
#include <ell/util.h>
22-
#pragma GCC diagnostic pop
23-
19+
#include <ell/ell.h>
2420

2521
#include <mptcpd/private/murmur_hash.h>
2622

lib/id_manager.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@
1919
#include <sys/socket.h>
2020
#include <netinet/in.h>
2121

22-
#pragma GCC diagnostic push
23-
#pragma GCC diagnostic ignored "-Wpedantic"
24-
#include <ell/hashmap.h>
25-
#include <ell/uintset.h>
26-
#include <ell/util.h>
27-
#include <ell/log.h>
28-
#include <ell/random.h>
29-
#pragma GCC diagnostic pop
22+
#include <ell/ell.h>
3023

3124
#include <mptcpd/private/murmur_hash.h>
3225
#include <mptcpd/private/id_manager.h>

lib/listener_manager.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919
#include <errno.h>
2020
#include <string.h>
2121

22-
#pragma GCC diagnostic push
23-
#pragma GCC diagnostic ignored "-Wpedantic"
24-
#include <ell/hashmap.h>
25-
#include <ell/util.h>
26-
#include <ell/log.h>
27-
#include <ell/random.h>
28-
#pragma GCC diagnostic pop
22+
#include <ell/ell.h>
2923

3024
#include <mptcpd/private/murmur_hash.h>
3125
#include <mptcpd/private/listener_manager.h>

lib/network_monitor.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@
2323
#include <net/if.h> // For standard network interface flags.
2424
#include <netinet/in.h>
2525

26-
#pragma GCC diagnostic push
27-
#pragma GCC diagnostic ignored "-Wpedantic"
28-
#include <ell/netlink.h>
29-
#include <ell/log.h>
30-
#include <ell/util.h>
31-
#include <ell/queue.h>
32-
#include <ell/timeout.h>
33-
#include <ell/rtnl.h>
34-
#pragma GCC diagnostic pop
26+
#include <ell/ell.h>
3527

3628
#include <mptcpd/private/path_manager.h>
3729
#include <mptcpd/private/sockaddr.h>

lib/path_manager.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616

1717
#include <netinet/in.h>
1818

19-
#pragma GCC diagnostic push
20-
#pragma GCC diagnostic ignored "-Wpedantic"
21-
#include <ell/genl.h>
22-
#include <ell/queue.h>
23-
#include <ell/util.h> // For L_STRINGIFY needed by l_error().
24-
#include <ell/log.h>
25-
#pragma GCC diagnostic pop
19+
#include <ell/ell.h>
2620

2721
#include <mptcpd/path_manager.h>
2822
#include <mptcpd/private/path_manager.h>

lib/plugin.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020
#include <unistd.h>
2121
#include <assert.h>
2222

23-
#pragma GCC diagnostic push
24-
#pragma GCC diagnostic ignored "-Wpedantic"
25-
#include <ell/queue.h>
26-
#include <ell/hashmap.h>
27-
#include <ell/util.h>
28-
#include <ell/log.h>
29-
#pragma GCC diagnostic pop
23+
#include <ell/ell.h>
3024

3125
/**
3226
* @todo Remove this preprocessor symbol definition once support for

lib/sockaddr.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
#include <sys/socket.h>
1212
#include <netinet/in.h>
1313

14-
#pragma GCC diagnostic push
15-
#pragma GCC diagnostic ignored "-Wpedantic"
16-
#include <ell/util.h>
17-
#pragma GCC diagnostic pop
14+
#include <ell/ell.h>
1815

1916
#include <mptcpd/private/sockaddr.h>
2017

plugins/path_managers/addr_adv.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313

1414
#include <errno.h>
1515

16-
#pragma GCC diagnostic push
17-
#pragma GCC diagnostic ignored "-Wpedantic"
18-
#include <ell/util.h> // For L_STRINGIFY needed by ELL log macros.
19-
#include <ell/log.h>
20-
#pragma GCC diagnostic pop
21-
16+
#include <ell/ell.h>
2217

2318
#include <mptcpd/private/path_manager.h>
2419
#include <mptcpd/private/configuration.h>

plugins/path_managers/sspi.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@
1717

1818
#include <netinet/in.h>
1919

20-
#pragma GCC diagnostic push
21-
#pragma GCC diagnostic ignored "-Wpedantic"
22-
#include <ell/util.h> // For L_STRINGIFY needed by l_error().
23-
#include <ell/log.h>
24-
#include <ell/queue.h>
25-
#pragma GCC diagnostic pop
20+
#include <ell/ell.h>
2621

2722
#include <mptcpd/network_monitor.h>
2823
#include <mptcpd/path_manager.h>

src/commands.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
#include <string.h>
1717
#include <arpa/inet.h>
1818

19-
#pragma GCC diagnostic push
20-
#pragma GCC diagnostic ignored "-Wpedantic"
21-
#include <ell/genl.h>
22-
#include <ell/util.h> // For L_STRINGIFY needed by l_error(), etc.
23-
#include <ell/log.h>
24-
#pragma GCC diagnostic pop
19+
#include <ell/ell.h>
2520

2621
#include "commands.h"
2722

0 commit comments

Comments
 (0)