Przeglądaj źródła

declare pointers passed to string functions as nonnull

tags/v0.9.3
Holger Lubitz 17 lat temu
rodzic
commit
7e8e4f8abd
1 zmienionych plików z 24 dodań i 24 usunięć
  1. 24
    24
      src/include/string.h

+ 24
- 24
src/include/string.h Wyświetl plik

@@ -17,32 +17,32 @@
17 17
 #include <stddef.h>
18 18
 #include <bits/string.h>
19 19
 
20
-int __pure strnicmp(const char *s1, const char *s2, size_t len);
21
-char * strcpy(char * dest,const char *src);
22
-char * strncpy(char * dest,const char *src,size_t count);
23
-char * strcat(char * dest, const char * src);
24
-char * strncat(char *dest, const char *src, size_t count);
25
-int __pure strcmp(const char * cs,const char * ct);
20
+int __pure strnicmp(const char *s1, const char *s2, size_t len) __nonnull;
21
+char * strcpy(char * dest,const char *src) __nonnull;
22
+char * strncpy(char * dest,const char *src,size_t count) __nonnull;
23
+char * strcat(char * dest, const char * src) __nonnull;
24
+char * strncat(char *dest, const char *src, size_t count) __nonnull;
25
+int __pure strcmp(const char * cs,const char * ct) __nonnull;
26 26
 int __pure strncmp(const char * cs,const char * ct,
27
-				     size_t count);
28
-char * __pure strchr(const char * s, int c);
29
-char * __pure strrchr(const char * s, int c);
30
-size_t __pure strlen(const char * s);
31
-size_t __pure strnlen(const char * s, size_t count);
32
-size_t __pure strspn(const char *s, const char *accept);
33
-size_t __pure strcspn(const char *s, const char *reject);
34
-char * __pure strpbrk(const char * cs,const char * ct);
35
-char * strtok(char * s,const char * ct);
36
-char * strsep(char **s, const char *ct);
37
-void * memset(void * s,int c,size_t count);
38
-void * memmove(void * dest,const void *src,size_t count);
27
+				     size_t count) __nonnull;
28
+char * __pure strchr(const char * s, int c) __nonnull;
29
+char * __pure strrchr(const char * s, int c) __nonnull;
30
+size_t __pure strlen(const char * s) __nonnull;
31
+size_t __pure strnlen(const char * s, size_t count) __nonnull;
32
+size_t __pure strspn(const char *s, const char *accept) __nonnull;
33
+size_t __pure strcspn(const char *s, const char *reject) __nonnull;
34
+char * __pure strpbrk(const char * cs,const char * ct) __nonnull;
35
+char * strtok(char * s,const char * ct) __nonnull;
36
+char * strsep(char **s, const char *ct) __nonnull;
37
+void * memset(void * s,int c,size_t count) __nonnull;
38
+void * memmove(void * dest,const void *src,size_t count) __nonnull;
39 39
 int __pure memcmp(const void * cs,const void * ct,
40
-				    size_t count);
41
-void * __pure memscan(const void * addr, int c, size_t size);
42
-char * __pure strstr(const char * s1,const char * s2);
43
-void * __pure memchr(const void *s, int c, size_t n);
44
-char * __pure strdup(const char *s);
45
-char * __pure strndup(const char *s, size_t n);
40
+				    size_t count) __nonnull;
41
+void * __pure memscan(const void * addr, int c, size_t size) __nonnull;
42
+char * __pure strstr(const char * s1,const char * s2) __nonnull;
43
+void * __pure memchr(const void *s, int c, size_t n) __nonnull;
44
+char * __pure strdup(const char *s) __nonnull;
45
+char * __pure strndup(const char *s, size_t n) __nonnull;
46 46
 
47 47
 extern const char * strerror ( int errno );
48 48
 

Ładowanie…
Anuluj
Zapisz