No description
  • C 98.3%
  • CMake 1.5%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Evan Burkey a1f108cf45
All checks were successful
test / test (push) Successful in 12s
test / sanitize (push) Successful in 15s
Update main libflint documentation
2026-09-24 08:12:35 -07:00
.forgejo/workflows ci: pin Alpine 3.24 for test and sanitize jobs 2026-08-23 07:24:19 -07:00
docs Update main libflint documentation 2026-09-24 08:12:35 -07:00
include Add allocation failure coverage and module review improvements 2026-09-24 06:47:33 -07:00
src Add allocation failure coverage and module review improvements 2026-09-24 06:47:33 -07:00
tests Add allocation failure coverage and module review improvements 2026-09-24 06:47:33 -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 allocation failure coverage and module review improvements 2026-09-24 06:47:33 -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 Correct module documentation and align writing style 2026-09-24 08:08:11 -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 3.17 or newer. 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.