Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/strlenopt.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* This is a replacement of needed parts from stdlib.h and string.h | 1 /* This is a replacement of needed parts from <stdlib.h> and <string.h> |
2 for -foptimize-strlen testing, to ensure we are testing the builtins | 2 for -foptimize-strlen testing, to ensure we are testing the builtins |
3 rather than whatever the OS has in its headers. */ | 3 rather than whatever the OS has in its headers. */ |
4 | 4 |
5 #define NULL ((void *) 0) | 5 #define NULL ((void *) 0) |
6 typedef __SIZE_TYPE__ size_t; | 6 typedef __SIZE_TYPE__ size_t; |
7 extern void abort (void); | 7 extern void abort (void); |
8 void *calloc (size_t, size_t); | |
8 void *malloc (size_t); | 9 void *malloc (size_t); |
9 void free (void *); | 10 void free (void *); |
10 char *strdup (const char *); | 11 char *strdup (const char *); |
11 size_t strlen (const char *); | 12 size_t strlen (const char *); |
12 size_t strnlen (const char *, size_t); | 13 size_t strnlen (const char *, size_t); |
13 void *memcpy (void *__restrict, const void *__restrict, size_t); | 14 void *memcpy (void *__restrict, const void *__restrict, size_t); |
14 void *memmove (void *, const void *, size_t); | 15 void *memmove (void *, const void *, size_t); |
15 char *strcpy (char *__restrict, const char *__restrict); | 16 char *strcpy (char *__restrict, const char *__restrict); |
16 char *strcat (char *__restrict, const char *__restrict); | 17 char *strcat (char *__restrict, const char *__restrict); |
17 char *strchr (const char *, int); | 18 char *strchr (const char *, int); |
19 int strcmp (const char *, const char *); | |
20 int strncmp (const char *, const char *, size_t); | |
18 void *memset (void *, int, size_t); | 21 void *memset (void *, int, size_t); |
19 int memcmp (const void *, const void *, size_t); | 22 int memcmp (const void *, const void *, size_t); |
20 int strcmp (const char *, const char *); | 23 int strcmp (const char *, const char *); |
21 #ifdef USE_GNU | 24 #ifdef USE_GNU |
22 void *mempcpy (void *__restrict, const void *__restrict, size_t); | 25 void *mempcpy (void *__restrict, const void *__restrict, size_t); |
23 char *stpcpy (char *__restrict, const char *__restrict); | 26 char *stpcpy (char *__restrict, const char *__restrict); |
24 #endif | 27 #endif |
28 | |
29 int sprintf (char * __restrict, const char *__restrict, ...); | |
30 int snprintf (char * __restrict, size_t, const char *__restrict, ...); | |
25 | 31 |
26 #if defined(FORTIFY_SOURCE) && FORTIFY_SOURCE > 0 && __OPTIMIZE__ | 32 #if defined(FORTIFY_SOURCE) && FORTIFY_SOURCE > 0 && __OPTIMIZE__ |
27 # define bos(ptr) __builtin_object_size (ptr, FORTIFY_SOURCE > 0) | 33 # define bos(ptr) __builtin_object_size (ptr, FORTIFY_SOURCE > 0) |
28 # define bos0(ptr) __builtin_object_size (ptr, 0) | 34 # define bos0(ptr) __builtin_object_size (ptr, 0) |
29 | 35 |