Skip to content

Add missing C standard library headers #77

@gtker

Description

@gtker

This isn't a shopping list of things we want implemented right now this is primarily to summarize what we have and what's missing, as well as categorize things that are unlikely to be useful.

  • assert.h
    • assert macro
    • (C11) static_assert macro
  • ctype.h
    • isspace function (takes char instead of int)
    • isalnum function
    • isalpha function
    • isblank function
    • iscntrl function
    • isdigit function
    • isgraph function
    • islower function
    • isprint function
    • ispunct function
    • isupper function
    • isxdigit function
    • tolower function
    • toupper function
  • errno.h
    • errno macro (there is one in fcntl.c)
    • EDOM define
    • EILSEQ define
    • ERANGE define
  • limits.h
    • CHAR_BIT
    • SCHAR_MIN
    • SCHAR_MAX
    • UCHAR_MIN
    • UCHAR_MAX
    • CHAR_MIN
    • CHAR_MAX
    • MB_LEN_MAX
    • SHRT_MIN
    • SHRT_MAX
    • USHRT_MAX
    • INT_MIN
    • INT_MAX
    • UINT_MAX
    • LONG_MIN
    • LONG_MAX
    • ULONG_MAX
    • LLONG_MIN
    • LLONG_MAX
    • ULLONG_MAX
  • setjmp.h
    • setjmp macro
    • jmp_buf type
    • longjmp function
  • stddef.h
    • ptrdiff_t type
    • size_t type
    • NULL macro
    • max_align_t type
    • offsetof macro
  • stdlib.h
    • EXIT_FAILURE define
    • EXIT_SUCCESS define
    • calloc function
    • free function
    • malloc function
    • getenv function
    • size_t type
    • div_t type
    • ldiv_t type
    • lldiv_t type
    • RAND_MAX define
    • atoi function
    • atol function
    • atoll function
    • strtold function
    • strtol function
    • strtoll function
    • strtoul function
    • strtoull function
    • rand function
    • srand function
    • realloc function
    • abort function
    • atexit function
    • exit function
    • _Exit function
    • system function
    • bsearch function
    • qsort function
    • abs function
    • labs function
    • llabs function
    • div function
    • ldiv function
    • lldiv function
  • string.h
    • memcpy function
    • memmove function
    • strcpy function
    • strncpy function
    • memcmp function
    • strcmp function
    • strlen function
    • strncmp function
    • memchr function
    • strchr function
    • strcspn function
    • strpbrk function
    • strrchr function
    • strspn function
    • strstr function
    • strcat function
    • strncat function
    • memset function
    • strcoll function
    • strxfrm function
    • strtok function
    • strerror function
  • time.h
    • CLOCKS_PER_SEC define
    • TIME_UTC define
    • clock_t type
    • time_t type
    • struct timespec type
    • struct tm type
    • clock function
    • difftime function
    • mktime function
    • time function
    • timespec_get function
    • asctime function
    • ctime function
    • gmtime function
    • localtime function
    • strftime function
  • stdio.h
    • FILE type
    • BUFSIZ define
    • EOF define
    • SEEK_CUR define
    • SEEK_END define
    • SEEK_SET define
    • stdin define
    • stdout define
    • stderr define
    • getchar function
    • fclose function
    • fflush function
    • fgets function
    • fputc function
    • fputs function
    • puts function
    • ungetc function
    • fread function
    • fwrite function
    • fseek function
    • ftell function
    • rewind function
    • TMP_MAX define
    • fpos_t type
    • _IOFBF define
    • _IOLBF define
    • _IONBF define
    • FOPEN_MAX define
    • FILENAME_MAX define
    • L_tmpnam define
    • remove function
    • rename function
    • tmpfile function
    • tmpnam function
    • fopen function
    • freopen function
    • setbuf function
    • setvbuf function
    • getc function
    • putc function
    • putchar function
    • fgetpos function
    • fsetpos function
    • clearerr function
    • feof function
    • ferror function
    • perror function
  • stdint.h
    • [u]int{8,16,32}_t type
    • [u]int64_t type
    • [u]int_least{8,16,32,64}_t type
    • [u]int_fast{8,16,32,64}_t type
    • intptr_t type
    • uintptr_t type
    • intmax_t type
    • uintmax_t type
    • uintmax_t type
    • INT{8,16,32,64}_MIN define
    • [U]INT{8,16,32,64}_MAX define
    • INT_LEAST{8,16,32,64}_MIN define
    • [U]INT_LEAST{8,16,32,64}_MAX define
    • INT_FAST{8,16,32,64}_MIN define
    • [U]INT_FAST{8,16,32,64}_MAX define
    • INTPTR_MIN define
    • INTPTR_MAX define
    • UINTPTR_MAX define
    • INTMAX_MIN define
    • INTMAX_MAX define
    • UINTMAX_MAX define
    • PTRDIFF_MIN define
    • PTRDIFF_MAX define
    • SIZE_MAX define
    • [U]INT{8,16,32,64}_C macro. Might be better to implement these in the compiler.
    • INTMAX_C macro
    • UINTMAX_C macro
  • signal.h, better function pointer support
  • inttypes.h, variadic functions and printf support

Requires additional implementation in M2-Planet

  • stdalign.h, _Alignof and _Alignas support
    • alignof macro
    • __alignas_is_defined define
    • alignas macro
    • __alignof_is_defined define

Unlikely to be useful

  • complex.h introduced in C99, standardized but not required. Define __STDC_NO_COMPLEX__ in compiler instead.
  • stdatomic.h introduced in C11, standardized but not required. Define __STDC_NO_ATOMICS__ in compiler instead.
  • threads.h introduced in C11, standardized but not required. Define __STDC_NO_THREADS__ in compiler instead.
  • char.h introduced in C11
  • wchar.h introduced in NA1 (1995)
  • wctype.h introduced in NA1 (1995)
  • fenv.h introduced in C99
  • float.h introduced in C89
  • locale.h introduced in C89
  • math.h introduced in C99
  • stdbit.h introduced in C23
  • tgmath.h introduced in C99

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions