Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [c23]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
61 views

Stub-based Unit Testing

Requirements: Following are the functions I need to test, along with the cases where they can fail: ...
Harith's user avatar
  • 7,414
6 votes
4 answers
869 views

An Attempt at Creating Generic min()/max() for Fundamental Types

The simplest way one can achieve this is to have separate functions for each type with a suffix to differentiate between them like the following: ...
Harith's user avatar
  • 7,414
3 votes
2 answers
59 views

Reading a file into lines (benchmarking getline() vs mmap_memchr() vs mmap_getline() vs fread())

This is a follow-up to: Reading a file into lines with mmap vs getline. The actual names of the functions are not ...
Harith's user avatar
  • 7,414
3 votes
3 answers
330 views

Append Buffer for Buffering Small write(2) Calls

The purpose of this is written in the comment below (it is meant to be used in a text editor): abuf.h: ...
Harith's user avatar
  • 7,414
7 votes
1 answer
215 views

Reading a file into lines with mmap vs getline

I required a function to read a file into lines for a text editor, and ended up with two routines. One uses getline(), and the other uses ...
Harith's user avatar
  • 7,414
4 votes
4 answers
315 views

Implementing basename, stpcpy, asprintf, vasprintf, strchrnul, and strcasecmp

C23 standarized strdup()/strndup(), but left out stpcpy(). ...
Harith's user avatar
  • 7,414
4 votes
2 answers
530 views

Abstracting away ANSI escape sequences

I have an application that requires ANSI escape sequences, so I have attempted to abstract away the magic strings out of the code (they were previously macros) into a separate translation layer, ...
Harith's user avatar
  • 7,414
7 votes
2 answers
669 views

Consolidating GNU C's and C23's attributes

C23 has introduced attribute specifier sequences. Consequently, the header below attempts to conditionally define macros for these sequences (for my own use cases). In cases where a compiler does not ...
Harith's user avatar
  • 7,414