hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit ef147dd680a4d01b5089ba67c8f0c95ad5700078
parent 98729cc2c4ba605fdd8350793f876fef177b017c
Author: Sebastian <sebastian@sebsite.pw>
Date:   Tue, 12 Mar 2024 18:27:56 -0400

fmt: ignore error in fatal/fatalf

If writing to stderr fails, then the abort handler will again try to
write to stderr. Since fatal terminates the program anyway, it makes
more sense to always terminate it the same way, rather than there being
a chance that the program will abort instead.

Diffstat:
Mfmt/wrappers.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fmt/wrappers.ha b/fmt/wrappers.ha @@ -44,7 +44,7 @@ export fn bsprintf(buf: []u8, fmt: str, args: field...) str = { // Formats text for printing and writes it to [[os::stderr]], followed by a line // feed, then exits the program with an error status. export fn fatalf(fmt: str, args: field...) never = { - fprintfln(os::stderr, fmt, args...)!; + fprintfln(os::stderr, fmt, args...): void; os::exit(255); }; @@ -52,7 +52,7 @@ export fn fatalf(fmt: str, args: field...) never = { // them to [[os::stderr]] separated by spaces and followed by a line feed, then // exits the program with an error status. export fn fatal(args: formattable...) never = { - fprintln(os::stderr, args...)!; + fprintln(os::stderr, args...): void; os::exit(255); };