Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586528 > unrolled thread

[PATCH] uapi: fix linux/kexec.h userspace compilation errors

Started by"Dmitry V. Levin" <ldv@altlinux.org>
First post2017-02-22 23:50 +0100
Last post2017-02-23 03:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] uapi: fix linux/kexec.h userspace compilation errors "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-22 23:50 +0100
    Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors ebiederm@xmission.com (Eric W. Biederman) - 2017-02-23 02:50 +0100
      Re: [PATCH] uapi: fix linux/kexec.h userspace compilation errors "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-23 03:20 +0100

#1586528 — [PATCH] uapi: fix linux/kexec.h userspace compilation errors

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-22 23:50 +0100
Subject[PATCH] uapi: fix linux/kexec.h userspace compilation errors
Message-ID<tdNTs-eQ-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1586602

Fromebiederm@xmission.com (Eric W. Biederman)
Date2017-02-23 02:50 +0100
Message-ID<tdQHD-2lQ-9@gated-at.bofh.it>
In reply to#1586528
"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.

[toc] | [prev] | [next] | [standalone]


#1586611

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-23 03:20 +0100
Message-ID<tdRaF-2LC-7@gated-at.bofh.it>
In reply to#1586602

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web