prevent null pointer access crashes/memory trashing.
[AROS.git] / compiler / stdc / stdc.conf
blobf84d9725a9eaa585da6eb510ae14c76a17f0a633
1 ##begin config
2 version 0.2
3 basename StdC
4 libbasetypeextern struct StdCBase
5 libbasetype struct StdCIntBase
6 options peropenerbase
7 ##end config
9 ##begin cdef
10 #include <libraries/stdc.h>
11 #include <setjmp.h>
12 #include <complex.h>
13 #include <fenv.h>
14 #include <math.h>
15 #include <signal.h>
16 #include <stdarg.h>
17 #include <stdlib.h>
18 #include <time.h>
20 #ifdef __GNUC__
21 #undef cimag
22 #undef cimagf
23 #undef cimagl
24 #undef creal
25 #undef crealf
26 #undef creall
27 #endif
29 /* Avoid warning for redefinition of isinf()/isnan() */
30 #define STDC_NOLIBINLINE
31 #define STDC_NOLIBDEFINES
33 ##end cdef
35 ##begin stubprivate
36 #define STDC_NOINLINE
37 ##end stubprivate
39 ##begin cdefprivate
40 #include "__stdc_intbase.h"
41 ##end cdefprivate
43 ##begin startup
44 #include "stdc_startup.c"
45 ##end startup
47 ##begin functionlist
48 # == Internal functions ==
50 int __stdc_gmtoffset(void)
51 void __stdc_program_startup(jmp_buf exitjmp, int *errorptr)
52 void __stdc_program_end(void)
53 int *__stdc_set_errorptr(int *errorptr)
54 int *__stdc_get_errorptr(void)
55 void __stdc_set_exitjmp(jmp_buf exitjmp, jmp_buf previousjmp)
56 void __stdc_jmp2exit(int normal, int returncode)
57 .skip 3
58 # == C99 functions ordered per include file ==
59 # * assert.h: Support function for assert() macro
60 .skip 1
61 #__stdc_assert(const char * expr, const char * file, unsigned int line)
62 #.alias __assert
64 # * complex.h
65 .skip 42
66 #double complex cacos(double complex z)
67 #float complex cacosf(float complex z)
68 #long double complex cacosl(long double complex z)
69 #double complex casin(double complex z)
70 #float complex casinf(float complex z)
71 #long double complex casinl(long double complex z)
72 #double complex catan(double complex z)
73 #float complex catanf(float complex z)
74 #long double complex catanl(long double complex z)
75 #double complex ccos(double complex z)
76 #float complex ccosf(float complex z)
77 #long double complex ccosl(long double complex z)
78 #double complex csin(double complex z)
79 #float complex csinf(float complex z)
80 #long double complex csinl(long double complex z)
81 #double complex ctan(double complex z)
82 #float complex ctanf(float complex z)
83 #long double complex ctanl(long double complex z)
84 #double complex cacosh(double complex z)
85 #float complex cacoshf(float complex z)
86 #long double complex cacoshl(long double complex z)
87 #double complex casinh(double complex z)
88 #float complex casinhf(float complex z)
89 #long double complex casinhl(long double complex z)
90 #double complex catanh(double complex z)
91 #float complex catanhf(float complex z)
92 #long double complex catanhl(long double complex z)
93 #double complex ccosh(double complex z)
94 #float complex ccoshf(float complex z)
95 #long double complex ccoshl(long double complex z)
96 #double complex csinh(double complex z)
97 #float complex csinhf(float complex z)
98 #long double complex csinhl(long double complex z)
99 #double complex ctanh(double complex z)
100 #float complex ctanhf(float complex z)
101 #long double complex ctanhl(long double complex z)
102 #double complex cexp(double complex z)
103 #float complex cexpf(float complex z)
104 #long double complex cexpl(long double complex z)
105 #double complex clog(double complex z)
106 #float complex clogf(float complex z)
107 #long double complex clogl(long double complex z)
108 double cabs(double complex z)
109 float cabsf(float complex z)
110 .skip 10
111 #long double cabsl(long double complex z)
112 #double complex cpow(double complex x, double complex y)
113 #float complex cpowf(float complex x, float complex y)
114 #long double complex cpowl(long double complex x, long double complex y)
115 #double complex csqrt(double complex z)
116 #float complex csqrtf(float complex z)
117 #long double complex csqrtl(long double complex z)
118 #double carg(double complex z)
119 #float cargf(float complex z)
120 #long double cargl(long double complex z)
121 double cimag(double complex z)
122 float cimagf(float complex z)
123 long double cimagl(long double complex z)
124 double complex conj(double complex z)
125 float complex conjf(float complex z)
126 long double complex conjl(long double complex z)
127 .skip 3
128 #double complex cproj(double complex z)
129 #float complex cprojf(float complex z)
130 #long double complex cprojl(long double complex z)
131 double creal(double complex z)
132 float crealf(float complex z)
133 long double creall(long double complex z)
135 # * ctype.h: functions are declared as static inline functions
137 # * errno.h
138 int __stdc_ioerr2errno(int ioerr)
139 .alias ioerr2errno
141 # * fenv.h
142 int feclearexcept(int excepts)
143 .function _feclearexcept
144 int fegetexceptflag(fexcept_t *flagp, int excepts)
145 .function _fegetexceptflag
146 int feraiseexcept(int excepts)
147 .function _feraiseexcept
148 int fesetexceptflag(const fexcept_t *flagp, int excepts)
149 .function _fesetexceptflag
150 int fetestexcept(int excepts)
151 .function _fetestexcept
152 int fegetround(void)
153 .function _fegetround
154 int fesetround(int round)
155 .function _fesetround
156 int fegetenv(fenv_t *envp)
157 .function _fegetenv
158 int feholdexcept(fenv_t *envp)
159 .function _feholdexcept
160 int fesetenv(const fenv_t *envp)
161 .function _fesetenv
162 int feupdateenv(const fenv_t *envp)
163 .function _feupdateenv
165 # * float.h: no functions in float.h
167 # * inttypes.h
168 .skip 2
169 #intmax_t imaxabs(intmax_t j)
170 #imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom)
171 intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base)
172 uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base)
173 .skip 2
174 #intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
175 #uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
177 # * iso646.h: no functions in iso646.h
179 # * limits.h: no functions in limits.h
181 # * locale.h
182 char *setlocale(int category, const char *locale)
183 struct lconv *localeconv(void)
185 # * math.h
186 .skip 3
187 #int __fpclassify(double)
188 #int __fpclassifyf(float)
189 #int __fpclassifyl(long double)
190 int __isfinite(double)
191 .unusedlibbase
192 .alias finite
193 int __isfinitef(float)
194 .unusedlibbase
195 .alias finitef
196 int __isfinitel(long double)
197 .unusedlibbase
198 .alias finitel
199 int __isinf(double)
200 .unusedlibbase
201 .alias isinf
202 int __isinff(float)
203 .unusedlibbase
204 .alias isinff
205 .skip 1
206 #int __isinfl(long double)
207 #.unusedlibbase
208 #.alias isinfl
209 int __isnan(double)
210 .unusedlibbase
211 .alias isnan
212 int __isnanf(float)
213 .unusedlibbase
214 .alias isnanf
215 int __isnanl(long double)
216 .unusedlibbase
217 .alias isnanl
218 int __isnormal(double)
219 .unusedlibbase
220 int __isnormalf(float)
221 .unusedlibbase
222 int __isnormall(long double)
223 .unusedlibbase
224 int __signbit(double)
225 .unusedlibbase
226 int __signbitf(float)
227 .unusedlibbase
228 int __signbitl(long double)
229 .unusedlibbase
230 double acos(double)
231 double asin(double)
232 double atan(double)
233 double atan2(double, double)
234 double cos(double)
235 double sin(double)
236 double tan(double)
237 double acosh(double)
238 double asinh(double)
239 double atanh(double)
240 double cosh(double)
241 double sinh(double)
242 double tanh(double)
243 double exp(double)
244 double exp2(double)
245 double expm1(double)
246 double frexp(double, int *)
247 int ilogb(double)
248 double ldexp(double, int)
249 double log(double)
250 double log10(double)
251 double log1p(double)
252 double log2(double) 
253 double logb(double)
254 double modf(double, double *)
255 double scalbn(double, int)
256 double scalbln(double, long)
257 double cbrt(double)
258 double fabs(double)
259 double hypot(double, double)
260 double pow(double, double)
261 double sqrt(double)
262 double erf(double)
263 double erfc(double)
264 double lgamma(double)
265 .alias gamma
266 .skip 1
267 #double tgamma(double)
268 double ceil(double)
269 double floor(double)
270 double nearbyint(double)
271 double rint(double)
272 long lrint(double)
273 long long llrint(double)
274 double round(double)
275 long lround(double)
276 long long llround(double)
277 double trunc(double)
278 double fmod(double, double)
279 double remainder(double, double)
280 .alias drem
281 double remquo(double, double, int *)
282 double copysign(double, double)
283 double nan(const char *tagp)
284 double nextafter(double, double)
285 double nexttoward(double, long double)
286 double fdim(double, double)
287 double fmax(double, double)
288 double fmin(double, double)
289 double fma(double, double, double)
290 float acosf(float)
291 float asinf(float)
292 float atanf(float)
293 float atan2f(float, float)
294 float cosf(float)
295 float sinf(float)
296 float tanf(float)
297 float acoshf(float)
298 float asinhf(float)
299 float atanhf(float)
300 float coshf(float)
301 float sinhf(float)
302 float tanhf(float)
303 float expf(float)
304 float exp2f(float)
305 float expm1f(float)
306 float frexpf(float, int *)
307 int ilogbf(float)
308 float ldexpf(float, int)
309 float logf(float)
310 float log10f(float)
311 float log1pf(float)
312 float log2f(float) 
313 float logbf(float)
314 float modff(float, float *)
315 float scalbnf(float, int)
316 float scalblnf(float, long)
317 float cbrtf(float)
318 float fabsf(float)
319 float hypotf(float, float)
320 float powf(float, float)
321 float sqrtf(float)
322 float erff(float)
323 float erfcf(float)
324 float lgammaf(float)
325 .alias gammaf
326 .skip 1
327 #float tgammaf(float)
328 float ceilf(float)
329 float floorf(float)
330 float nearbyintf(float)
331 float rintf(float)
332 long lrintf(float)
333 long long llrintf(float)
334 float roundf(float)
335 long lroundf(float)
336 long long llroundf(float)
337 float truncf(float)
338 float fmodf(float, float)
339 float remainderf(float, float)
340 .alias dremf
341 float remquof(float, float, int *)
342 float copysignf(float, float)
343 float nanf(const char *tagp)
344 float nextafterf(float, float)
345 float nexttowardf(float, long double)
346 float fdimf(float, float)
347 float fmaxf(float, float)
348 float fminf(float, float)
349 float fmaf(float, float, float)
350 .skip 16
351 #long double acosl(long double)
352 #long double asinl(long double)
353 #long double atanl(long double)
354 #long double atan2l(long double, long double)
355 #long double cosl(long double)
356 #long double sinl(long double)
357 #long double tanl(long double)
358 #long double acoshl(long double)
359 #long double asinhl(long double)
360 #long double atanhl(long double)
361 #long double coshl(long double)
362 #long double sinhl(long double)
363 #long double tanhl(long double)
364 #long double expl(long double)
365 #long double exp2l(long double)
366 #long double expm1l(long double)
367 long double frexpl(long double value, int *)
368 int ilogbl(long double)
369 long double ldexpl(long double, int)
370 .skip 5
371 #long double logl(long double)
372 #long double log10l(long double)
373 #long double log1pl(long double)
374 #long double log2l(long double)
375 #long double logbl(long double)
376 long double modfl(long double, long double *)
377 long double scalbnl(long double, int)
378 long double scalblnl(long double, long)
379 .skip 1
380 #long double cbrtl(long double)
381 long double fabsl(long double)
382 .skip 7
383 #long double hypotl(long double, long double)
384 #long double powl(long double, long double)
385 #long double sqrtl(long double)
386 #long double erfl(long double)
387 #long double erfcl(long double)
388 #long double lgammal(long double)
389 #.alias gammal
390 #long double tgammal(long double)
391 long double ceill(long double)
392 long double floorl(long double)
393 .skip 4
394 #long double nearbyintl(long double)
395 #long double rintl(long double)
396 #long lrintl(long double)
397 #long long llrintl(long double)
398 long double roundl(long double)
399 long lroundl(long double)
400 long long llroundl(long double)
401 long double truncl(long double)
402 .skip 3
403 #long double fmodl(long double, long double)
404 #long double remainderl(long double, long double)
405 #.alias dreml
406 #long double remquol(long double, long double, int *)
407 long double copysignl(long double, long double)
408 long double nanl(const char *tagp)
409 long double nextafterl(long double, long double)
410 long double nexttowardl(long double, long double)
411 long double fdiml(long double, long double)
412 long double fmaxl(long double, long double)
413 long double fminl(long double, long double)
414 long double fmal(long double, long double, long double)
416 # * setjmp.h
417 int setjmp(jmp_buf env)
418 .unusedlibbase
419 void longjmp(jmp_buf env, int val)
420 .unusedlibbase
422 # * signal.h
423 __sighandler_t *signal(int, __sighandler_t *)
424 int raise(int)
426 # * stdarg.h: implementation has to be provided by the compiler.
428 # * stdbool.h: no functions in stdbool.h
430 # * stddef.h: no functions in stddef.h
432 # * stdint.h: no functions in stdint.h
434 # * stdio.h: only string based functions are implemented, the rest in stdcio.library
435 int snprintf(char * restrict s, size_t n, const char * restrict format, ...)
436 int sprintf(char * restrict s, const char * restrict format, ...)
437 int sscanf(const char * restrict s, const char * restrict format, ...)
438 int vsnprintf(char * restrict s, size_t n, const char * restrict format, va_list arg)
439 int vsprintf(char * restrict s, const char * restrict format, va_list arg)
440 int vsscanf(const char * restrict s, const char * restrict format, va_list arg)
442 # * stdlib.h: getenv() and system() implemented in stdcio.library
443 double atof(const char *nptr)
444 int atoi(const char *nptr)
445 long int atol(const char *nptr)
446 .skip 1
447 #long long int atoll(const char *nptr)
448 double strtod(const char * restrict nptr, char ** restrict endptr)
449 .skip 1
450 #float strtof(const char * restrict nptr, char ** restrict endptr)
451 long double strtold(const char * restrict nptr, char ** restrict endptr)
452 long int strtol(const char * restrict nptr, char ** restrict endptr, int base)
453 long long int strtoll(const char * restrict nptr, char ** restrict endptr, int base)
454 unsigned long int strtoul(const char * restrict nptr, char ** restrict endptr, int base)
455 unsigned long long int strtoull(const char * restrict nptr, char ** restrict endptr, int base)
456 int rand(void)
457 void srand(unsigned int seed)
458 void *calloc(size_t count, size_t size)
459 void free(void *memory)
460 void *malloc(size_t size)
461 void *malloc_align(size_t size, size_t alignment)
462 void *realloc(void *oldmem, size_t newsize)
463 void *realloc_nocopy(void *oldmem, size_t newsize)
464 void abort(void)
465 int atexit(void (*func)(void))
466 int on_exit(void (*func)(int, void *), void *)
467 void exit(int code)
468 void _Exit(int)
469 .alias _exit
470 void *bsearch(const void * key, const void * base, size_t count, size_t size, int (*comparefunction)(const void *, const void *))
471 void qsort(void * array, size_t count, size_t elementsize, int (*comparefunction)(const void * element1, const void * element2))
472 int abs(int j)
473 long labs(long j)
474 long long llabs(long long j)
475 div_t div(int numer, int denom)
476 ldiv_t ldiv(long int numer, long int denom)
477 lldiv_t lldiv(long long int numer, long long int denom)
478 int mblen(const char *s, size_t n)
479 .skip 4
480 #int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n)
481 #int wctomb(char *s, wchar_t wc)
482 #size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n)
483 #size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n)
485 # * string.h: memcpy is the same as memmove
486 void *memmove (void * dest, const void * src, size_t n)
487 .unusedlibbase
488 .alias memcpy
489 char *strcpy (char * restrict dest, const char * restrict src)
490 .unusedlibbase
491 char *strncpy (char * restrict dest, const char * restrict src, size_t n)
492 .unusedlibbase
493 char *strcat (char * restrict dest, const char * restrict src)
494 .unusedlibbase
495 char *strncat (char * restrict dest, const char * restrict src, size_t n)
496 .unusedlibbase
497 int memcmp (const void * s1, const void * s2, size_t n)
498 .unusedlibbase
499 int strcmp (const char * s1, const char * s2)
500 .unusedlibbase
501 int strcoll (const char *s1, const char *s2)
502 .unusedlibbase
503 int strncmp (const char * s1, const char * s2, size_t n)
504 .unusedlibbase
505 size_t strxfrm (char * restrict s1, const char * restrict s2, size_t n)
506 .unusedlibbase
507 void *memchr (const void * dest, int c, size_t n)
508 .unusedlibbase
509 char *strchr (const char * s, int c)
510 .unusedlibbase
511 .alias index
512 size_t strcspn (const char *s1, const char *s2)
513 .unusedlibbase
514 char *strpbrk (const char * s1, const char * s2)
515 .unusedlibbase
516 char *strrchr (const char * s, int c)
517 .unusedlibbase
518 .alias rindex
519 size_t strspn (const char * s1, const char * s2)
520 .unusedlibbase
521 char *strstr (const char * buf, const char * str)c
522 .unusedlibbase
523 char *strtok (char * str, const char * sep)v
524 void *memset (void * dest, int c, size_t n)
525 .unusedlibbase
526 char *__stdc_strerror (int n)
527 .alias strerror
528 size_t strlen (const char * str)
529 .unusedlibbase
531 # * tgmath.h: not implemented in stdc.library
533 # * time.h
534 clock_t clock(void)
535 double difftime(time_t, time_t)
536 .unusedlibbase
537 time_t mktime(struct tm *)
538 .unusedlibbase
539 time_t time(time_t *)
540 char *asctime(const struct tm *)
541 char *ctime(const time_t *)
542 struct tm *gmtime(const time_t *)
543 struct tm *localtime(const time_t *)
544 size_t strftime(char *, size_t, const char *, const struct tm *)
546 # * wchar.h: not implemented in stdc.library
548 # * wctype.h: not implemented in stdc.library
550 # == Extensions ==
551 # <math.h>: Mostly BSD functions
552 double j0(double)
553 double j1(double)
554 double jn(int, double)
555 double scalb(double, double)
556 double y0(double)
557 double y1(double)
558 double yn(int, double)
559 double gamma_r(double, int *)
560 double lgamma_r(double, int *)
561 void sincos(double, double *, double *)
562 double significand(double)
563 float j0f(float)
564 float j1f(float)
565 float jnf(int, float)
566 float scalbf(float, float)
567 float y0f(float)
568 float y1f(float)
569 float ynf(int, float)
570 float gammaf_r(float, int *)
571 float lgammaf_r(float, int *)
572 void sincosf(float, float *, float *)
573 float significandf(float)
574 .skip 9
575 #long double j0l(long double)
576 #long double j1l(long double)
577 #long double jnl(int, long double)
578 #long double scalbl(long double, long double)
579 #long double y0l(long double)
580 #long double y1l(long double)
581 #long double ynl(int, long double)
582 #long double gammal_r(long double, int *)
583 #long double lgammal_r(long double, int *)
584 void sincosl(long double, long double *, long double *)
585 .skip 1
586 #long double significandl(long double)
588 # * stdio.h: AROS specific support functions based on libnix
589 int __vcformat(void * data, int (*outc)(int, void *), const char * format, va_list args)
590 int __vcscan(void * data, int (*getc)(void *), int (*ungetc)(int, void *), const char * format, va_list args)
592 # * string.h: POSIX, BSD/UNIX, SAS/C
593 .skip 1
594 #void *memccpy(void *restrict, const void *restrict, int, size_t)
595 char *stpcpy(char *restrict, const char *restrict)
596 .skip 2
597 #char *stpncpy(char *restrict, const char *restrict, size_t)
598 #int strcoll_l(const char *, const char *, locale_t)
599 char *strdup(const char *)
600 .skip 2
601 #char *strerror_l(int, locale_t)
602 #int strerror_r(int, char *, size_t)
603 char *strndup(const char *, size_t)
604 size_t strnlen (const char *, size_t)
605 .unusedlibbase
606 .skip 1
607 #char *strsignal(int)
608 char *strtok_r(char *restrict, const char *restrict, char **restrict)
609 .skip 1
610 #size_t strxfrm_l(char *restrict, const char *restrict, size_t, locale_t)
611 size_t strlcpy(char *dst, const char *src, size_t size)
612 .unusedlibbase
613 size_t strlcat(char *dst, const char *src, size_t size)
614 .unusedlibbase
615 char *strsep(char **, const char *)
616 char *strlwr(char *)
617 .unusedlibbase
618 char *strupr(char *)
619 .unusedlibbase
620 char *strrev(char * s)
621 .unusedlibbase
622 int stch_l(const char * in, long * lvalue)
623 .unusedlibbase
624 int stcd_l(const char * in, long * lvalue)
625 .unusedlibbase
626 int stco_l(const char * in, long * lvalue)
627 .unusedlibbase
628 int stcl_d(char * out, long lvalue)
629 .unusedlibbase
630 int stcl_h(char * out, long lvalue)
631 .unusedlibbase
632 int stcl_o(char * out, long lvalue)
633 .unusedlibbase
634 int stcu_d(char * out, unsigned uivalue)
635 size_t stccpy(char *str1_ptr, const char *str2_ptr, size_t max)
636 .unusedlibbase
637 char *stpsym(char *str_ptr, char *dest_ptr, int dest_size)
638 .unusedlibbase
639 char *stpblk( const char * str )
641 # * strings.h: POSIX, BSD
642 int strcasecmp(const char * s1, const char * s2)
643 .skip 1
644 #int strcasecmp_l(const char *, const char *, locale_t)
645 int strncasecmp(const char *, const char *, size_t)
646 .skip 1
647 #int strncasecmp_l(const char *, const char *, size_t, locale_t)
649 # * time.h: reentrant versions of some C99 functions (POSIX)
650 char *asctime_r(const struct tm *, char *)
651 char *ctime_r(const time_t *, char *)
652 struct tm *gmtime_r(const time_t *, struct tm *)
653 struct tm *localtime_r(const time_t *, struct tm *)
655 ##end functionlist