Add missing C standard library headers

Open
#77 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

The issue is a broad checklist of missing C standard-library headers and features, with no source files, tests, or entry points named. Start by selecting one narrowly scoped unchecked header and checking its dependencies, especially the items noted as requiring additional M2-Planet implementation. Done should be defined for that specific header or feature rather than the entire checklist.

Written by the indexing model from the issue text.

Description

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
Dominant language
C
Stars
27
Forks
20
Avg merge
5d 12h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oriansj/M2libc

All issues in oriansj/M2libc

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.