All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uapi: fix linux/kexec.h userspace compilation errors
@ 2017-02-22 22:46 ` Dmitry V. Levin
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry V. Levin @ 2017-02-22 22:46 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, linux-kernel

Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
linux/kexec.h userspace compilation errors:

/usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
  size_t bufsz;
/usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
  size_t memsz;

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/kexec.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
index aae5ebf..7def5f5 100644
--- a/include/uapi/linux/kexec.h
+++ b/include/uapi/linux/kexec.h
@@ -45,6 +45,9 @@
 #define KEXEC_SEGMENT_MAX 16
 
 #ifndef __KERNEL__
+
+#include <stddef.h>    /* For size_t. */
+
 /*
  * This structure is used to hold the arguments that are used when
  * loading  kernel binaries.
-- 
ldv

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

* [PATCH] uapi: fix linux/kexec.h userspace compilation errors
@ 2017-02-22 22:46 ` Dmitry V. Levin
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry V. Levin @ 2017-02-22 22:46 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, linux-kernel

Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
linux/kexec.h userspace compilation errors:

/usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
  size_t bufsz;
/usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
  size_t memsz;

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/kexec.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
index aae5ebf..7def5f5 100644
--- a/include/uapi/linux/kexec.h
+++ b/include/uapi/linux/kexec.h
@@ -45,6 +45,9 @@
 #define KEXEC_SEGMENT_MAX 16
 
 #ifndef __KERNEL__
+
+#include <stddef.h>    /* For size_t. */
+
 /*
  * This structure is used to hold the arguments that are used when
  * loading  kernel binaries.
-- 
ldv

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors
  2017-02-22 22:46 ` Dmitry V. Levin
@ 2017-02-23  1:37   ` Eric W. Biederman
  -1 siblings, 0 replies; 6+ messages in thread
From: Eric W. Biederman @ 2017-02-23  1:37 UTC (permalink / raw)
  To: Dmitry V. Levin; +Cc: kexec, linux-kernel

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
> linux/kexec.h userspace compilation errors:
>
> /usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
>   size_t bufsz;
> /usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
>   size_t memsz;

Were these failures generated with a static checker?

What changed that you are seeing new failures in old essentially static
headers?

Eric




> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/kexec.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
> index aae5ebf..7def5f5 100644
> --- a/include/uapi/linux/kexec.h
> +++ b/include/uapi/linux/kexec.h
> @@ -45,6 +45,9 @@
>  #define KEXEC_SEGMENT_MAX 16
>  
>  #ifndef __KERNEL__
> +
> +#include <stddef.h>    /* For size_t. */
> +
>  /*
>   * This structure is used to hold the arguments that are used when
>   * loading  kernel binaries.

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

* Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors
@ 2017-02-23  1:37   ` Eric W. Biederman
  0 siblings, 0 replies; 6+ messages in thread
From: Eric W. Biederman @ 2017-02-23  1:37 UTC (permalink / raw)
  To: Dmitry V. Levin; +Cc: kexec, linux-kernel

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
> linux/kexec.h userspace compilation errors:
>
> /usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
>   size_t bufsz;
> /usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
>   size_t memsz;

Were these failures generated with a static checker?

What changed that you are seeing new failures in old essentially static
headers?

Eric




> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/kexec.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
> index aae5ebf..7def5f5 100644
> --- a/include/uapi/linux/kexec.h
> +++ b/include/uapi/linux/kexec.h
> @@ -45,6 +45,9 @@
>  #define KEXEC_SEGMENT_MAX 16
>  
>  #ifndef __KERNEL__
> +
> +#include <stddef.h>    /* For size_t. */
> +
>  /*
>   * This structure is used to hold the arguments that are used when
>   * loading  kernel binaries.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors
  2017-02-23  1:37   ` Eric W. Biederman
@ 2017-02-23  2:07     ` Dmitry V. Levin
  -1 siblings, 0 replies; 6+ messages in thread
From: Dmitry V. Levin @ 2017-02-23  2:07 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, linux-kernel

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

On Thu, Feb 23, 2017 at 02:37:46PM +1300, Eric W. Biederman wrote:
> "Dmitry V. Levin" <ldv@altlinux.org> writes:
> 
> > Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
> > linux/kexec.h userspace compilation errors:
> >
> > /usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
> >   size_t bufsz;
> > /usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
> >   size_t memsz;
> 
> Were these failures generated with a static checker?

Yes, with
gcc -S -o/dev/null -xc /dev/null -include /usr/include/linux/kexec.h

> What changed that you are seeing new failures in old essentially static
> headers?

Every uapi header file should be standalone, i.e. it must include,
directly or indirectly, every definition it uses, so that no user
should have to guess header dependencies.

It's not the first time I'm seeing this compilation error,
but now I've got some time to submit a fix.  Better late than never.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors
@ 2017-02-23  2:07     ` Dmitry V. Levin
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry V. Levin @ 2017-02-23  2:07 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: kexec, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 995 bytes --]

On Thu, Feb 23, 2017 at 02:37:46PM +1300, Eric W. Biederman wrote:
> "Dmitry V. Levin" <ldv@altlinux.org> writes:
> 
> > Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
> > linux/kexec.h userspace compilation errors:
> >
> > /usr/include/linux/kexec.h:53:2: error: unknown type name 'size_t'
> >   size_t bufsz;
> > /usr/include/linux/kexec.h:55:2: error: unknown type name 'size_t'
> >   size_t memsz;
> 
> Were these failures generated with a static checker?

Yes, with
gcc -S -o/dev/null -xc /dev/null -include /usr/include/linux/kexec.h

> What changed that you are seeing new failures in old essentially static
> headers?

Every uapi header file should be standalone, i.e. it must include,
directly or indirectly, every definition it uses, so that no user
should have to guess header dependencies.

It's not the first time I'm seeing this compilation error,
but now I've got some time to submit a fix.  Better late than never.


-- 
ldv

[-- Attachment #1.2: Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2017-02-23  2:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 22:46 [PATCH] uapi: fix linux/kexec.h userspace compilation errors Dmitry V. Levin
2017-02-22 22:46 ` Dmitry V. Levin
2017-02-23  1:37 ` Eric W. Biederman
2017-02-23  1:37   ` Eric W. Biederman
2017-02-23  2:07   ` Dmitry V. Levin
2017-02-23  2:07     ` Dmitry V. Levin

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.