No description
  • C 98.3%
  • CMake 1.4%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Evan Burkey 6bce4b0e8c
All checks were successful
test / test (push) Successful in 16s
test / sanitize (push) Successful in 18s
ci: pin Alpine 3.24 for test and sanitize jobs
Untagged alpine on the runner is 3.23, whose gcc 15.2 ASan
fails to link on musl.
2026-08-23 07:24:19 -07:00
.forgejo/workflows ci: pin Alpine 3.24 for test and sanitize jobs 2026-08-23 07:24:19 -07:00
docs docs: write for library users, drop em dashes 2026-08-15 21:11:01 -07:00
include Add BST, hash set, rb_force_push, and SM_ANY wildcards 2026-08-15 21:07:22 -07:00
src Add BST, hash set, rb_force_push, and SM_ANY wildcards 2026-08-15 21:07:22 -07:00
tests Add BST, hash set, rb_force_push, and SM_ANY wildcards 2026-08-15 21:07:22 -07:00
.gitignore clean 2026-04-22 19:00:37 -07:00
clanggen.sh Implement Server (#1) 2024-07-09 21:03:23 +00:00
CMakeLists.txt Add BST, hash set, rb_force_push, and SM_ANY wildcards 2026-08-15 21:07:22 -07:00
LICENSE init 2021-02-01 14:06:37 -08:00
Makefile fix compiler warnings 2024-08-13 12:57:36 -07:00
README.md docs: write for library users, drop em dashes 2026-08-15 21:11:01 -07:00

libflint

A C library of containers and helpers. Supports Linux, macOS, OpenBSD, and FreeBSD.

Documentation

Module documentation. The files under tests/ are also usable as examples.

Building

CMake is required. Use CMake directly, or the Makefile, which is a thin wrapper around it.

CMake

# If libflint is in ./lib/libflint
add_subdirectory(lib/libflint)

# when building a target...
target_link_libraries(${TARGET} PRIVATE flint)

The flint target exports include/, so you do not need a separate target_include_directories for libflint headers. Compile definitions stay on the flint target and are not added to the rest of your project.

Testing

cmake -B build && cmake --build build
ctest --test-dir build                # run all tests
ctest --test-dir build --parallel     # run in parallel
ctest --test-dir build --label-exclude slow  # skip slow tests (macos)

# AddressSanitizer + UndefinedBehaviorSanitizer
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DFLINT_SANITIZE=ON
cmake --build build && ctest --test-dir build --output-on-failure -LE slow

Requirements

A C99 compiler and CMake. Linux needs libbsd (strtonum in the input module). macOS, OpenBSD, and FreeBSD need no extra libraries.

Libraries

Overflow-checked array allocation is provided as lf_reallocarray in lfcompat.h on every platform.