From 9eb1e37a643040fd4ff35c7ca207c136bf6fb0bb Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 8 Nov 2023 21:55:11 +0100 Subject: [PATCH] use access from gcc 11 for userspace --- userspace/libc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/userspace/libc.h b/userspace/libc.h index 411ac0e..2b431c0 100644 --- a/userspace/libc.h +++ b/userspace/libc.h @@ -13,15 +13,15 @@ #define EOF (-1) -int memcmp(const void *s1, const void *s2, size_t n); -void *memcpy(void *dest, const void *src, size_t n); -void *memset(void *s, int c, size_t n); +__attribute__ ((access (read_only, 1, 3), access (read_only, 2, 3))) int memcmp(const void *s1, const void *s2, size_t n); +__attribute__ ((access (write_only, 1, 3), access (read_only, 2, 3))) void *memcpy(void *dest, const void *src, size_t n); +__attribute__ ((access (write_only, 1, 3))) void *memset(void *s, int c, size_t n); char *itoa(long long int value, char *str, int base); void reverse(char s[]); int strlen(const char s[]); -unsigned int strnlen(const char *s, size_t count); +__attribute__ ((access (read_only, 1, 2))) unsigned int strnlen(const char *s, size_t count); int strcmp(const char s1[], const char s2[]); -char *strzcpy(char *dst, const char *src, int len); +__attribute__ ((access (read_only, 2), access (write_only, 1, 3))) char *strzcpy(char *dst, const char *src, int len); int puts(const char *str); int putc(const int c); int vsnprintf(char *str, size_t size, const char *format, va_list ap);