{"thread":{"id":"26683","subject":"[PATCH] Honor HP C's noreturn attribute","startedAt":"2011-03-07T12:13:15Z","lastAt":"2011-03-08T22:09:41Z","messageCount":4,"participants":["Michal Rokos","Junio C Hamano","Piotr Krukowiecki"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"162904","messageId":"32EABE0E-2447-4189-A3CE-05B68A5E18EF@nextsoft.cz","threadId":"26683","inReplyTo":null,"subject":"[PATCH] Honor HP C's noreturn attribute","fromName":"Michal Rokos","fromEmail":"rokos@nextsoft.cz","sentAt":"2011-03-07T12:13:15Z","receivedAt":"2011-03-07T12:13:15Z","isPatch":true,"sender":{"key":"michal.rokos@nextsoft.cz","avatar":null},"body":"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.\n\nThe __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.\n\nSigned-off-by: Michal Rokos <michal.rokos@nextsoft.cz>\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 9c23622..bf947b1 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -214,7 +214,10 @@ extern char *gitbasename(char *);\n #define is_dir_sep(c) ((c) == '/')\n #endif\n \n-#ifdef __GNUC__\n+#if __HP_cc >= 61000\n+#define NORETURN __attribute__((noreturn))\n+#define NORETURN_PTR\n+#elif defined(__GNUC__)\n #define NORETURN __attribute__((__noreturn__))\n #define NORETURN_PTR __attribute__((__noreturn__))\n #elif defined(_MSC_VER)\n\n--\n\nMichal Rokos\n\nNextSoft spol. s r.o.\nVyskočilova 1/1410\n140 21 Praha 4\nCzech Republic\nmobile: +420 736 646 591\nfax:    +420 267 224 307\ne-mail: rokos@nextsoft.cz\n"},{"id":"163000","messageId":"7v4o7dfndw.fsf@alter.siamese.dyndns.org","threadId":"26683","inReplyTo":"32EABE0E-2447-4189-A3CE-05B68A5E18EF@nextsoft.cz","subject":"Re: [PATCH] Honor HP C's noreturn attribute","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-08T19:00:43Z","receivedAt":"2011-03-08T19:00:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michal Rokos <rokos@nextsoft.cz> writes:\n\n> HP C for Integrity servers (Itanium) gained support for noreturn\n> attribute sometime in 2006. It was released in Compiler Version A.06.10\n> and made available in July 2006.\n>\n> The __HP_cc define detects the HP C compiler version. Precede the\n> __GNUC__ check so it works well when compiling with HP C using -Agcc\n> option that enables partial support for the GNU C dialect. The -Agcc\n> defines the __GNUC__ too.\n>\n> Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>\n\nWe tend to prefer new code be appended at the end of if/elif/.../then/fi\ncascade when there is no strong reason to do otherwise; your log message\nclearly explains why this particular #if needs to come before the existing\none.\n\nI love it when people write a very readable log message to explain why the\npatch _has_ to be the way it is.  Very good job.\n\nExcept for the overlooooooooong lines in the message, which I line-wrapped\nlocally before applying, that is.\n\nThanks.\n"},{"id":"163004","messageId":"AANLkTi=FPkccc3Rk3YDuEsN3YGt_U1NhhT2MGHmbrAra@mail.gmail.com","threadId":"26683","inReplyTo":"7v4o7dfndw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Honor HP C's noreturn attribute","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-03-08T19:26:43Z","receivedAt":"2011-03-08T19:26:43Z","isPatch":true,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"On Tue, Mar 8, 2011 at 8:00 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Michal Rokos <rokos@nextsoft.cz> writes:\n>\n>> HP C for Integrity servers (Itanium) gained support for noreturn\n>> attribute sometime in 2006. It was released in Compiler Version A.06.10\n>> and made available in July 2006.\n>>\n>> The __HP_cc define detects the HP C compiler version. Precede the\n>> __GNUC__ check so it works well when compiling with HP C using -Agcc\n>> option that enables partial support for the GNU C dialect. The -Agcc\n>> defines the __GNUC__ too.\n>>\n>> Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>\n>\n> We tend to prefer new code be appended at the end of if/elif/.../then/fi\n> cascade when there is no strong reason to do otherwise; your log message\n> clearly explains why this particular #if needs to come before the existing\n> one.\n>\n> I love it when people write a very readable log message to explain why the\n> patch _has_ to be the way it is.  Very good job.\n\nI liked it too, but it'd be even better to put the comment in the code IMO.\nI don't think anyone would check the commit to see if he can change the\norder of the #ifdefs ...\n\n(So please comment in code more!)\n\n\n-- \nPiotr Krukowiecki\n"},{"id":"163033","messageId":"3597D63F-589A-4BD5-B052-FA720A593301@nextsoft.cz","threadId":"26683","inReplyTo":"7v4o7dfndw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Honor HP C's noreturn attribute","fromName":"Michal Rokos","fromEmail":"rokos@nextsoft.cz","sentAt":"2011-03-08T22:09:41Z","receivedAt":"2011-03-08T22:09:41Z","isPatch":true,"sender":{"key":"michal.rokos@nextsoft.cz","avatar":null},"body":"Dear Junio,\n\nOn 8.3.2011, at 20:00, Junio C Hamano wrote:\n\n> Michal Rokos <rokos@nextsoft.cz> writes:\n> \n>> The __HP_cc define detects the HP C compiler version. Precede the\n>> __GNUC__ check so it works well when compiling with HP C using -Agcc\n>> option that enables partial support for the GNU C dialect. The -Agcc\n>> defines the __GNUC__ too.\n> \n> I love it when people write a very readable log message to explain why the\n> patch _has_ to be the way it is.  Very good job.\n> \n> Except for the overlooooooooong lines in the message, which I line-wrapped\n> locally before applying, that is.\n\n\nthank you for your review. I will try to improve overall patch and the commit\nlog quality when sending something more.\n\nMichal\n\n--\n\nMichal Rokos\n\nNextSoft spol. s r.o.\nVyskočilova 1/1410\n140 21 Praha 4\nCzech Republic\nmobile: +420 736 646 591\nfax:    +420 267 224 307\ne-mail: rokos@nextsoft.cz\n"}]}