Thread (12 messages) flat view 12 messages, 4 authors, 2d ago

Re: [PATCH] compat/winansi: fix die_lasterr() argument formatting

From: Johannes Sixt <hidden>
Date: 2026-09-16 07:10:04

Am 16.09.26 um 08:33 schrieb René Scharfe:
That all makes sense, but is quite complicated.  die_errno() itself uses
a fixed-size buffer to avoid heap allocation, for robustness and to
avoid changing errno.  How about turning die_lasterr() into a macro for
the same reasons?

	#define die_lasterr(...) do { \
		errno = err_win_to_posix(GetLastError()); \
		die_errno(__VA_ARGS__); \
	} while (0)
die_lasterr is used to diagnose errors of Windows functions. I dislike
that this degrades the exact error value of GetLastError() into an
errno. If this direction is persued, then we should remove die_errno
from the picture.

But as I hinted elsewhere in the thread, this is all overengineered for
no good reason.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help