All of lore.kernel.org
 help / color / mirror / Atom feed
From: "AreaZR via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: AreaZR <gfunni234@gmail.com>, Seija Kijin <doremylover123@gmail.com>
Subject: [PATCH v3] die: fix inconsistencies with usage header
Date: Wed, 18 Dec 2024 03:28:03 +0000	[thread overview]
Message-ID: <pull.1439.v3.git.git.1734492483383.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1439.v2.git.git.1674160131967.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

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1439%2FAreaZR%2Fperror-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1439/AreaZR/perror-v3
Pull-Request: https://github.com/git/git/pull/1439

Range-diff vs v2:

 1:  c3b436cea9d ! 1:  e02d5982a4f die: fix inconsistencies with usage header
     @@ Commit message
      
          Signed-off-by: Seija Kijin <doremylover123@gmail.com>
      
     - ## contrib/credential/osxkeychain/git-credential-osxkeychain.c ##
     -@@ contrib/credential/osxkeychain/git-credential-osxkeychain.c: 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;
     -
       ## contrib/credential/wincred/git-credential-wincred.c ##
      @@
     + 
       #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
       
     - __attribute__((format (printf, 1, 2)))
     +-__attribute__((format (printf, 1, 2)))
      -static void die(const char *err, ...)
     ++__attribute__((format (printf, 1, 2), __noreturn__))
      +static void NORETURN die(const char *err, ...)
       {
       	char msg[4096];


 contrib/credential/wincred/git-credential-wincred.c | 4 ++--
 usage.c                                             | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c
index 4be0d58cd89..9e1b590d27b 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -12,8 +12,8 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
-__attribute__((format (printf, 1, 2)))
-static void die(const char *err, ...)
+__attribute__((format (printf, 1, 2), __noreturn__))
+static void NORETURN die(const char *err, ...)
 {
 	char msg[4096];
 	va_list params;
diff --git a/usage.c b/usage.c
index 29a9725784a..991efe25a54 100644
--- a/usage.c
+++ b/usage.c
@@ -210,7 +210,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;
@@ -221,8 +221,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: d882f382b3d939d90cfa58d17b17802338f05d66
-- 
gitgitgadget

      reply	other threads:[~2024-12-18  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 19:34 [PATCH] die: fix inconsistencies with header Rose via GitGitGadget
2023-01-19 20:28 ` [PATCH v2] die: fix inconsistencies with usage header Rose via GitGitGadget
2024-12-18  3:28   ` AreaZR via GitGitGadget [this message]

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=pull.1439.v3.git.git.1734492483383.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=doremylover123@gmail.com \
    --cc=gfunni234@gmail.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.