All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genl: Include system header to fix build warning
@ 2019-10-30 20:16 Mat Martineau
  2019-10-31  6:14 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Mat Martineau @ 2019-10-30 20:16 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

The l_genl_msg_append_attrv() declaration in genl.h uses struct iovec *,
but there's no guarantee that sys/uio.h has been included already (and
the genl user might not need that header itself). Within the ell code,
uio.h is already included by util.h which prevents build errors in ell
itself.
---
 ell/genl.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ell/genl.h b/ell/genl.h
index 5df688b..3a37ed5 100644
--- a/ell/genl.h
+++ b/ell/genl.h
@@ -26,6 +26,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
+#include <sys/uio.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] genl: Include system header to fix build warning
  2019-10-30 20:16 [PATCH] genl: Include system header to fix build warning Mat Martineau
@ 2019-10-31  6:14 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-10-31  6:14 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

Hi Mat,

> The l_genl_msg_append_attrv() declaration in genl.h uses struct iovec *,
> but there's no guarantee that sys/uio.h has been included already (and
> the genl user might not need that header itself). Within the ell code,
> uio.h is already included by util.h which prevents build errors in ell
> itself.
> ---
> ell/genl.h | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/ell/genl.h b/ell/genl.h
> index 5df688b..3a37ed5 100644
> --- a/ell/genl.h
> +++ b/ell/genl.h
> @@ -26,6 +26,7 @@
> #include <stdbool.h>
> #include <stddef.h>
> #include <stdint.h>
> +#include <sys/uio.h>

I would rather forward declare struct iovec than including a header from a public ELL header.

Regards

Marcel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-31  6:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 20:16 [PATCH] genl: Include system header to fix build warning Mat Martineau
2019-10-31  6:14 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.