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

[PATCH] die: fix inconsistencies with header

From
RGRose via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 19, 2023, 19:34 UTC
Message-ID
<pull.1439.git.git.1674156875354.gitgitgadget@gmail.com>
From: Seija Kijin <doremylover123@gmail.com>

The headers for the die and usage functions have different parameter names or are missing the "NORETURN" attribute

Signed-off-by: Seija Kijin <doremylover123@gmail.com>
---
    die: fix inconsistencies with header
    
    The headers for the die and usage functions have different parameter
    names or are missing the "NORETURN" attribute
    
    Signed-off-by: Seija Kijin doremylover123@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1439%2FAtariDreams%2Fperror-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1439/AtariDreams/perror-v1
Pull-Request: https://github.com/git/git/pull/1439
 contrib/credential/osxkeychain/git-credential-osxkeychain.c | 2 +-
 contrib/credential/wincred/git-credential-wincred.c         | 2 +-
 usage.c                                                     | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index e29cc28779d..fa88d621865 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -11,7 +11,7 @@ static char *password;
 static UInt16 port;
 
 __attribute__((format (printf, 1, 2)))
-static void die(const char *err, ...)
+static void NORETURN die(const char *err, ...)
 {
 	char msg[4096];
 	va_list params;
diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c
index ead6e267c78..c0610d7648c 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -12,7 +12,7 @@
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
 __attribute__((format (printf, 1, 2)))
-static void die(const char *err, ...)
+static void NORETURN die(const char *err, ...)
 {
 	char msg[4096];
 	va_list params;
diff --git a/usage.c b/usage.c
index 5a7c6c346c1..5f5510ceeeb 100644
--- a/usage.c
+++ b/usage.c
@@ -206,7 +206,7 @@ static const char *fmt_with_err(char *buf, int n, const char *fmt)
 	return buf;
 }
 
-void NORETURN die_errno(const char *fmt, ...)
+void NORETURN die_errno(const char *err, ...)
 {
 	char buf[1024];
 	va_list params;
@@ -217,8 +217,8 @@ void NORETURN die_errno(const char *fmt, ...)
 		exit(128);
 	}
 
-	va_start(params, fmt);
-	die_routine(fmt_with_err(buf, sizeof(buf), fmt), params);
+	va_start(params, err);
+	die_routine(fmt_with_err(buf, sizeof(buf), err), params);
 	va_end(params);
 }
 

base-commit: a7caae2729742fc80147bca1c02ae848cb55921a
-- 
gitgitgadget
Next: Rose via GitGitGadget
Message 1 of 3 in “die: fix inconsistencies with header”
  1. die: fix inconsistencies with headerRose via GitGitGadget, Jan 19, 2023
  2. die: fix inconsistencies with usage headerRose via GitGitGadget, Jan 19, 2023
  3. die: fix inconsistencies with usage headerAreaZR via GitGitGadget, Dec 18, 2024

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.