diff mbox series

[RFC,kvm-unit-tests,01/27] lib/string: include stddef.h for size_t

Message ID 20230127114108.10025-2-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series [RFC,kvm-unit-tests,01/27] lib/string: include stddef.h for size_t | expand

Commit Message

Joey Gouly Jan. 27, 2023, 11:40 a.m. UTC
Don't implicitly rely on this header being included.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
---
 lib/string.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Huth Jan. 31, 2023, 2:43 p.m. UTC | #1
On 27/01/2023 12.40, Joey Gouly wrote:
> Don't implicitly rely on this header being included.
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> ---
>   lib/string.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/lib/string.h b/lib/string.h
> index b07763ea..758dca8a 100644
> --- a/lib/string.h
> +++ b/lib/string.h
> @@ -7,6 +7,8 @@
>   #ifndef _STRING_H_
>   #define _STRING_H_
>   
> +#include <stddef.h>  /* For size_t */
> +
>   extern size_t strlen(const char *buf);
>   extern size_t strnlen(const char *buf, size_t maxlen);
>   extern char *strcat(char *dest, const char *src);

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/lib/string.h b/lib/string.h
index b07763ea..758dca8a 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -7,6 +7,8 @@ 
 #ifndef _STRING_H_
 #define _STRING_H_
 
+#include <stddef.h>  /* For size_t */
+
 extern size_t strlen(const char *buf);
 extern size_t strnlen(const char *buf, size_t maxlen);
 extern char *strcat(char *dest, const char *src);