-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ell: only include 'ell/ell.h' header #309
Conversation
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: multipath-tcp#302 Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Pull Request Test Coverage Report for Build 11531189571Details
💛 - Coveralls |
I'm not fond of convenience headers like For cases like If you really want to include |
Hi @ossama-othman, Thank you for your reviews!
I agree with you. I don't like this way, and I think it is better to have self-contained header files.
I initialled looked at that -- in fact, my first intention was to only modify mptcpd first, to include
Honestly, I would prefer not to use |
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:
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.
While at it, we can also remove the pragma to ignore
-Wpedantic
as it looks like it was caused by the factell/ell.h
was not used.Closes: #302