Git development
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: "René Scharfe" <l.s.r@web.de>, "Yongqiang Tian" <yqtian668@gmail.com>
Cc: Patrick Steinhardt <ps@pks.im>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] compat/winansi: fix die_lasterr() argument formatting
Date: Wed, 16 Sep 2026 09:09:51 +0200	[thread overview]
Message-ID: <1e706ce8-bebd-4ac1-914a-a55195e7d253@kdbg.org> (raw)
In-Reply-To: <bf0351d8-05fe-4f77-958a-2ac59495029c@web.de>

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


  reply	other threads:[~2026-09-16  7:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  4:23 [PATCH] compat/winansi: fix die_lasterr() argument formatting Yongqiang Tian
2026-09-16  4:29 ` Junio C Hamano
2026-09-16  6:13 ` Johannes Sixt
2026-09-16  6:33 ` René Scharfe
2026-09-16  7:09   ` Johannes Sixt [this message]
2026-09-21  3:00     ` Yongqiang Tian
2026-09-21  4:06       ` Johannes Sixt
2026-09-21  6:20 ` [PATCH v2] " Yongqiang Tian
2026-09-21 17:18   ` Junio C Hamano
2026-09-21 23:49     ` Yongqiang Tian
2026-09-21 23:47   ` [PATCH v3] " Yongqiang Tian
2026-09-23  4:41     ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e706ce8-bebd-4ac1-914a-a55195e7d253@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=l.s.r@web.de \
    --cc=ps@pks.im \
    --cc=yqtian668@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox