Skip to contentSkip to conversation

uapi: fix linux/kexec.h userspace compilation errors

PATCH In review Dmitry V. Levin 2 participants 3 messages Feb 22, 2017 – Feb 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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;

---
 include/uapi/linux/kexec.h | 3 +++
 1 file changed, 3 insertions(+)
include/uapi/linux/kexec.h +3 -0
index aae5ebf..7def5f5 100644
@@ -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.
Signature · 6 lines
ldv

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 7 lines · Dmitry V. Levin

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

Quoted 19 lines
---
 include/uapi/linux/kexec.h | 3 +++
 1 file changed, 3 insertions(+)
include/uapi/linux/kexec.h +3 -0
index aae5ebf..7def5f5 100644
@@ -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.
#2 lore raw
Quoted 11 lines · Eric W. Biederman
Quoted 7 lines · Dmitry V. Levin

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

Quoted 2 lines

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.

Signature · 1 line
ldv

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec