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

[PATCH 1/2] increase portability of NORETURN declarations

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Sep 14, 2009, 11:49 UTC
Message-ID
<1252928973-6280-1-git-send-email-kusmabite@gmail.com>

Some compilers (including at least MSVC) supports NORETURN on function declarations, but only before the function-name.

This patch makes it possible to define NORETURN for those compilers.
Signed-off-by: Erik Faye-Lund <kusmab...@gmail.com>
---

This patch requires specifying "-C 2" to "git am" to apply to the current maint(7fb6bcf), but I suspect that it's not really needed there. Supporting new compilers is going to require additional patching anyway.

 git-compat-util.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index e5e9f39..5876d91 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -177,9 +177,9 @@ extern char *gitbasename(char *);
 #include "compat/bswap.h"
 
 /* General helper functions */
-extern void usage(const char *err) NORETURN;
-extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
-extern void die_errno(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
+extern NORETURN void usage(const char *err);
+extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));
+extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
 extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
 extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
 
-- 
1.6.4.msysgit.0.16.gd92d4.dirty
Message 1 of 1 in “increase portability of NORETURN declarations”
  1. 1/2 increase portability of NORETURN declarationsErik Faye-Lund, Sep 14, 2009

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.