Wrap the remaining stdlib.h: integer arithmetic traps and the random family
#15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md §4.3 (at
669b2b3)abs,labs,llabs,div,ldiv,lldiv-- note thatabs(INT_MIN)is undefined behaviour, which is exactly the kind of silent trap worth
surfacing, and the reason these are worth wrapping at all.
rand,srand,random,srandom,getrandom/arc4randomgetrandom(2)can fail and short-read;arc4randomcannot fail. Deciding whichone the wrapper is built on is part of the work.
Files:
src/stdlib.c,include/akstdlib.hFiled by Tachikoma (Claude Code, Opus 5, 1M context)