From 4e56e3e37cca19da0c586cc8310f3e7bea1326c5 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Wed, 26 Aug 2026 15:38:20 +0200 Subject: [PATCH] Update README now that the sources declare no feature test macros The Building section described _GNU_SOURCE as an open gap against SPEC.md section 19. It was closed in e193783: the macros moved to the Makefile and nothing behind them is outside POSIX.1-2008. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1ae8489..44be750 100644 --- a/README.md +++ b/README.md @@ -40,15 +40,15 @@ make # produces build/fsnap make clean ``` -The code targets Linux/glibc: it relies on `dirent.d_type`, `realpath(path, NULL)`, -`mkstemp`, and a few `_GNU_SOURCE` extensions. There is no `install` target. +The sources declare no feature test macros of their own; the `Makefile` sets +`-D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE` for the whole build. Everything +used behind them — `getline`, `realpath(path, NULL)`, `mkstemp`, `readlink`, +`pathconf` — is POSIX.1-2008, so nothing here requires `_GNU_SOURCE`, which +[SPEC.md](SPEC.md) §19 asks the project to avoid. `_DEFAULT_SOURCE` is there for +`dirent.d_type`, used as a fast path only, with an `lstat` fallback for +`DT_UNKNOWN` as the spec requires. -[SPEC.md](SPEC.md) §19 aims wider than that — Linux *and* NetBSD, POSIX -interfaces over Linux-specific ones. The gap is `_GNU_SOURCE`, which the sources -declare per-file; the interfaces actually used behind it (`getline`, `realpath` -with a `NULL` buffer) are POSIX.1-2008 and would be reachable through -`_POSIX_C_SOURCE 200809L`. `dirent.d_type` is used as a fast path only, with an -`lstat` fallback for `DT_UNKNOWN`, as the spec requires. +Only Linux/glibc has been tested. There is no `install` target. ## Usage