No description
  • C 98.3%
  • CMake 1.4%
  • Shell 0.2%
Find a file
Evan Burkey 736962f73e
Some checks failed
test / sanitize (push) Failing after 6s
test / test (push) Successful in 12s
docs: write for library users, drop em dashes
Module pages describe the public contract: what to call, what
you own, and what the return values mean. Historical bugs,
rename notes, and implementer asides are gone. Examples use
generic paths.
2026-08-15 21:11:01 -07:00
.forgejo/workflows build: enable -Wall -Wextra and an ASan+UBSan CI job 2026-08-15 20:08:09 -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.