r/cprogramming • u/Mainak1224x • 4d ago
Added a pure C99, Rust-inspired error handling module (<cerror.h>) to my library arstd
https://github.com/mainak55512/arstdJust added <cerror.h> to arstd (my C99 arena standard library) to bring Rust-style Result ergonomics to strict ISO C99—with zero compiler extensions (no typeof or statement expressions) so it compiles cleanly across GCC, Clang, and MSVC.
It includes typed Result wrappers, 3-arg and 4-arg TRY propagation, UNWRAP/EXPECT/UNWRAP_OR, and an optional custom error table with built-in CERROR_OK and CERROR_DEFAULT fallbacks:
;
;
ResInt
ResStr
Repo: https://github.com/mainak55512/arstd
0
Upvotes
1
u/Key_River7180 4d ago
i am happy with tuples thx
1
u/YogurtclosetLow7064 3d ago
Cool