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

[PATCH] Honor HP C's noreturn attribute

From
MRMichal Rokos <rokos@nextsoft.cz>
Date
Mar 7, 2011, 12:13 UTC
Message-ID
<32EABE0E-2447-4189-A3CE-05B68A5E18EF@nextsoft.cz>
HP C for Integrity servers (Itanium) gained support for noreturn attribute sometime in 2006. It was released in Compiler Version A.06.10 and made available in July 2006.
The __HP_cc define detects the HP C compiler version. Precede the __GNUC__ check so it works well when compiling with HP C using -Agcc option that enables partial support for the GNU C dialect. The -Agcc defines the __GNUC__ too.
Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
diff --git a/git-compat-util.h b/git-compat-util.h
index 9c23622..bf947b1 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -214,7 +214,10 @@ extern char *gitbasename(char *);
 #define is_dir_sep(c) ((c) == '/')
 #endif
 
-#ifdef __GNUC__
+#if __HP_cc >= 61000
+#define NORETURN __attribute__((noreturn))
+#define NORETURN_PTR
+#elif defined(__GNUC__)
 #define NORETURN __attribute__((__noreturn__))
 #define NORETURN_PTR __attribute__((__noreturn__))
 #elif defined(_MSC_VER)

--

Michal Rokos

NextSoft spol. s r.o.
Vyskočilova 1/1410
140 21 Praha 4
Czech Republic
mobile: +420 736 646 591
fax:    +420 267 224 307
e-mail: rokos@nextsoft.cz
Next: Junio C Hamano
Message 1 of 4 in “Honor HP C's noreturn attribute”
  1. Honor HP C's noreturn attributeMichal Rokos, Mar 7, 2011
  2. Junio C HamanoMar 8, 2011
  3. Piotr KrukowieckiMar 8, 2011
  4. Michal RokosMar 8, 2011

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.