git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Sep 16, 2026, 07:09 UTC
Message-ID
<1e706ce8-bebd-4ac1-914a-a55195e7d253@kdbg.org>
In-Reply-To
<bf0351d8-05fe-4f77-958a-2ac59495029c@web.de>
Am 16.09.26 um 08:33 schrieb René Scharfe:
Show 9 quoted lines
> 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
Previous: René ScharfeNext: Yongqiang Tian
Message 5 of 12 in “compat/winansi: fix die_lasterr() argument formatting”
  1. compat/winansi: fix die_lasterr() argument formattingYongqiang Tian, Sep 16, 2026
  2. Junio C HamanoSep 16, 2026
  3. Johannes SixtSep 16, 2026
  4. René ScharfeSep 16, 2026
  5. Johannes SixtSep 16, 2026
  6. Yongqiang TianSep 21, 2026
  7. Johannes SixtSep 21, 2026
  8. compat/winansi: fix die_lasterr() argument formattingYongqiang Tian, Sep 21, 2026
  9. Junio C HamanoSep 21, 2026
  10. Yongqiang TianSep 21, 2026
  11. compat/winansi: fix die_lasterr() argument formattingYongqiang Tian, Sep 21, 2026
  12. Johannes SixtSep 23, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.