{"thread":{"id":"19456","subject":"[RFC/PATCH 0/2] OpenSolaris 2008.11 portability fixes","startedAt":"2009-05-23T19:24:55Z","lastAt":"2009-06-11T17:42:45Z","messageCount":15,"participants":["Junio C Hamano","Brandon Casey","Jeff King","Tomas Carnecky"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"114530","messageId":"1243106697-6424-1-git-send-email-gitster@pobox.com","threadId":"19456","inReplyTo":null,"subject":"[RFC/PATCH 0/2] OpenSolaris 2008.11 portability fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-23T19:24:55Z","receivedAt":"2009-05-23T19:24:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Two small patches that seem to make things better for me on OpenSolaris\n2008.11; I am primarily interested in learning if this regresses for other\nvintages of Solaris.\n\nJunio C Hamano (2):\n  Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6\n  OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV\n\n Makefile          |    4 +++-\n git-compat-util.h |    2 ++\n 2 files changed, 5 insertions(+), 1 deletions(-)\n"},{"id":"114534","messageId":"1243106697-6424-2-git-send-email-gitster@pobox.com","threadId":"19456","inReplyTo":"1243106697-6424-1-git-send-email-gitster@pobox.com","subject":"[RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-23T19:24:56Z","receivedAt":"2009-05-23T19:24:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"In git-compat-util.h, we do\n\n    #define _XOPEN_SOURCE 600\n    #define _XOPEN_SOURCE_EXTENDED 1\n\nunless we are on BSD or SCO.\n\nOn OpenSolaris (200811), /usr/include/sys/feature_tests.h has this nice\ntable:\n\n    Feature Test Macro\t\t\t\t     Specification\n    ------------------------------------------------  -------------\n    _XOPEN_SOURCE                                         XPG3\n    _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4\n    _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2\n    _XOPEN_SOURCE = 500                                   XPG5\n    _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6\n\nLater in the same header, compilation with -c99 is made to fail if _XPG6 is\nnot set, like this:\n\n    #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))\n    #error \"Compiler or options invalid for pre-UNIX 03 X/Open applications \\\n            and pre-2001 POSIX applications\"\n    #elif ...\n\nThe problem is that they check things in an order that is inconvenient for\nus.  When they see _XOPEN_SOURCE_EXTENDED, they declare that we are XPG4v2,\nregardless of the value of _XOPEN_SOURCE.\n\nTo work around this problem, do not define _XOPEN_SOURCE_EXTENDED on\nSun's.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-compat-util.h |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex c7cf2d5..4236647 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -41,8 +41,10 @@\n \n #if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n+#ifndef __sun__\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n+#endif\n #define _ALL_SOURCE 1\n #define _GNU_SOURCE 1\n #define _BSD_SOURCE 1\n-- \n1.6.3.1.145.gb74d77\n"},{"id":"114535","messageId":"1243106697-6424-3-git-send-email-gitster@pobox.com","threadId":"19456","inReplyTo":"1243106697-6424-2-git-send-email-gitster@pobox.com","subject":"[RFC/PATCH 2/2] OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-23T19:24:57Z","receivedAt":"2009-05-23T19:24:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 26d180c..a23846b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -698,7 +698,9 @@ ifeq ($(uname_S),SunOS)\n \tNO_MEMMEM = YesPlease\n \tNO_HSTRERROR = YesPlease\n \tNO_MKDTEMP = YesPlease\n-\tOLD_ICONV = UnfortunatelyYes\n+\tifneq ($(uname_R),5.11)\n+\t\tOLD_ICONV = UnfortunatelyYes\n+\tendif\n \tifeq ($(uname_R),5.8)\n \t\tNO_UNSETENV = YesPlease\n \t\tNO_SETENV = YesPlease\n-- \n1.6.3.1.145.gb74d77\n"},{"id":"114931","messageId":"WLNdjYtfqcg2bT6yOBtAykIqOBTeSLRUdlB6-sTM2KzTjwOmzN3fLg@cipher.nrlssc.navy.mil","threadId":"19456","inReplyTo":"1243106697-6424-2-git-send-email-gitster@pobox.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-05-28T16:46:50Z","receivedAt":"2009-05-28T16:46:50Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> In git-compat-util.h, we do\n> \n>     #define _XOPEN_SOURCE 600\n>     #define _XOPEN_SOURCE_EXTENDED 1\n> \n> unless we are on BSD or SCO.\n> \n> On OpenSolaris (200811), /usr/include/sys/feature_tests.h has this nice\n> table:\n> \n>     Feature Test Macro\t\t\t\t     Specification\n>     ------------------------------------------------  -------------\n>     _XOPEN_SOURCE                                         XPG3\n>     _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4\n>     _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2\n>     _XOPEN_SOURCE = 500                                   XPG5\n>     _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6\n> \n> Later in the same header, compilation with -c99 is made to fail if _XPG6 is\n> not set, like this:\n> \n>     #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))\n>     #error \"Compiler or options invalid for pre-UNIX 03 X/Open applications \\\n>             and pre-2001 POSIX applications\"\n>     #elif ...\n> \n> The problem is that they check things in an order that is inconvenient for\n> us.  When they see _XOPEN_SOURCE_EXTENDED, they declare that we are XPG4v2,\n> regardless of the value of _XOPEN_SOURCE.\n> \n> To work around this problem, do not define _XOPEN_SOURCE_EXTENDED on\n> Sun's.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  git-compat-util.h |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n> \n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index c7cf2d5..4236647 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h\n> @@ -41,8 +41,10 @@\n>  \n>  #if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)\n>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n> +#ifndef __sun__\n\n__sun__ is not defined by the SUNWspro compiler.  We can fix that by adding\na -D__sun__ in the SunOS section of the Makefile though.\n\nA more important issue, is that now that this causes _XPG6 to be defined,\nsun's header files _require_ a c99 compiler to be used.\n\nHere's the comment that goes along with the partial snippet that you showed\nabove from /usr/include/sys/feature_tests.h:\n\n  /*\n   * It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application\n   * using c99.  The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,\n   * and POSIX.1c applications. Likewise, it is invalid to compile an XPG6\n   * or a POSIX.1-2001 application with anything other than a c99 or later\n   * compiler.  Therefore, we force an error in both cases.\n   */\n\nAnd the rest of the macro implements the check for source/compiler\nsuitability.\n\nSo we either require compiling with a c99 compiler (by ensuring that\n_XPG6 is set) or exclude compiling with a c99 compiler on sun (by\nensuring that _XPG6 is not set).  Actually, this would only affect Solaris\nversions which support XPG6.  Solaris 11 and 10 do.  I don't know about\nSolaris 9 and 8.  Solaris 7 doesn't.\n\nWhich do we want to do?\n\n>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n>  #endif\n> +#endif\n>  #define _ALL_SOURCE 1\n>  #define _GNU_SOURCE 1\n>  #define _BSD_SOURCE 1\n"},{"id":"114946","messageId":"20090528191940.GG13499@coredump.intra.peff.net","threadId":"19456","inReplyTo":"WLNdjYtfqcg2bT6yOBtAykIqOBTeSLRUdlB6-sTM2KzTjwOmzN3fLg@cipher.nrlssc.navy.mil","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-28T19:19:40Z","receivedAt":"2009-05-28T19:19:40Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 28, 2009 at 11:46:50AM -0500, Brandon Casey wrote:\n\n> So we either require compiling with a c99 compiler (by ensuring that\n> _XPG6 is set) or exclude compiling with a c99 compiler on sun (by\n> ensuring that _XPG6 is not set).  Actually, this would only affect Solaris\n> versions which support XPG6.  Solaris 11 and 10 do.  I don't know about\n> Solaris 9 and 8.  Solaris 7 doesn't.\n> \n> Which do we want to do?\n\nFWIW, I didn't even try using sun's cc. I have been doing all of my\nbuilds using gcc 3.1.1 (from around 2002, which is what happens to be\navailable on the old-ish Solaris install at my university).\n\n-Peff\n"},{"id":"114949","messageId":"kZP6fFCtTQSG03irLxGArpacn-5pYEauMj-b0VWwhzPWMGiC_XnsYw@cipher.nrlssc.navy.mil","threadId":"19456","inReplyTo":"20090528191940.GG13499@coredump.intra.peff.net","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-05-28T19:40:14Z","receivedAt":"2009-05-28T19:40:14Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Jeff King wrote:\n> On Thu, May 28, 2009 at 11:46:50AM -0500, Brandon Casey wrote:\n> \n>> So we either require compiling with a c99 compiler (by ensuring that\n>> _XPG6 is set) or exclude compiling with a c99 compiler on sun (by\n>> ensuring that _XPG6 is not set).  Actually, this would only affect Solaris\n>> versions which support XPG6.  Solaris 11 and 10 do.  I don't know about\n>> Solaris 9 and 8.  Solaris 7 doesn't.\n>>\n>> Which do we want to do?\n> \n> FWIW, I didn't even try using sun's cc. I have been doing all of my\n> builds using gcc 3.1.1 (from around 2002, which is what happens to be\n> available on the old-ish Solaris install at my university).\n\nIt's not the compiler that prevents compilation.  It's the header files.\n\nYou mentioned that on Solaris 8 there was only a single declaration for\niconv.  There was not a macro check for _XPG6.  I suspect that Solaris 8\ndoes not support XPG6, so your compilation is just falling back to XPG4.\nThe same thing happens on Solaris 7.  On Solaris 10, if the macros are\nset such that _XPG6 becomes set, then compilation will fail if the\ncompiler is not a c99 one.\n\n-brandon\n"},{"id":"114952","messageId":"20090528195057.GA14360@coredump.intra.peff.net","threadId":"19456","inReplyTo":"kZP6fFCtTQSG03irLxGArpacn-5pYEauMj-b0VWwhzPWMGiC_XnsYw@cipher.nrlssc.navy.mil","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-28T19:50:57Z","receivedAt":"2009-05-28T19:50:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 28, 2009 at 02:40:14PM -0500, Brandon Casey wrote:\n\n> It's not the compiler that prevents compilation.  It's the header files.\n> \n> You mentioned that on Solaris 8 there was only a single declaration for\n> iconv.  There was not a macro check for _XPG6.  I suspect that Solaris 8\n> does not support XPG6, so your compilation is just falling back to XPG4.\n\nOK, that makes sense.\n\n> The same thing happens on Solaris 7.  On Solaris 10, if the macros are\n> set such that _XPG6 becomes set, then compilation will fail if the\n> compiler is not a c99 one.\n\nRight. What I was trying to say is \"gcc 3.1.1 is probably c99 enough,\nand I am using it already\". That is, if you were asking how painful it\nwould be to require a c99 compiler for Solaris git, I am saying I don't\npersonally care.\n\nBut I don't know what is \"normal\".\n\n-Peff\n"},{"id":"114959","messageId":"7viqjlge16.fsf@alter.siamese.dyndns.org","threadId":"19456","inReplyTo":"WLNdjYtfqcg2bT6yOBtAykIqOBTeSLRUdlB6-sTM2KzTjwOmzN3fLg@cipher.nrlssc.navy.mil","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-28T20:37:09Z","receivedAt":"2009-05-28T20:37:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> So we either require compiling with a c99 compiler (by ensuring that\n> _XPG6 is set) or exclude compiling with a c99 compiler on sun (by\n> ensuring that _XPG6 is not set).  Actually, this would only affect Solaris\n> versions which support XPG6.  Solaris 11 and 10 do.  I don't know about\n> Solaris 9 and 8.  Solaris 7 doesn't.\n>\n> Which do we want to do?\n\nIf possible, both ;-), because people would have or want to use different\ncompilers.\n\nI use \"gcc -std=c99\" on all platforms I compile git on (for details see\n\"Make\" in the 'todo' branch; I have a checkout of the todo branch at Meta/\nand say \"Meta/Make --pedantic\" from the toplevel), and that is how I\nnoticed this breakage on OpenSolaris 08.11 (it identifies itself as 5.11,\nso presumably it falls into \"Solaris 11\" category you cited above?)\n\n>> diff --git a/git-compat-util.h b/git-compat-util.h\n>> index c7cf2d5..4236647 100644\n>> --- a/git-compat-util.h\n>> +++ b/git-compat-util.h\n>> @@ -41,8 +41,10 @@\n>>  \n>>  #if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)\n>>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n\nJudging from their header files, I guess Sun's attitude is incompatible\nwith the above comment for _XOPEN_SOURCE.  We say \"... need 500\" and set\nit to 600 because we merely mean \"need to be at least 500\" by \"need 500\",\nbut Sun wants us to be very precise.  So instead of saying __sun__, we\ncould do something more explicit with a huge comment...\n\n\t#if !defined(__APPLE__) ...\n        # define _XOPEN_SOURCE 600\n        /*\n         * On Solaris, when _XOPEN_EXTENDED is set, its header file\n         * forces the programs to be XPG4v2, defeating the _XOPEN_SOURCE\n         * setting we just made to say we are XPG6.  Also on Solaris,\n         * XPG6 programs must be compiled with a c99 compiler, while\n         * non XPG6 programs must be compiled with a pre-c99 compiler.\n         */\n        # if defined(__sun__) && !(__STDC_VERSION__ - 0 >= 199901L)\n        # define _XOPEN_EXTENDED 1 /* AIX 5.3L wants this */\n        # endif\n\t#endif\n\nWe might want to flatten this a bit more to special case Solaris, which\nmight make it easier to maintain, e.g.\n\n\t#if defined(__sun__)\n        # ... whatever _XOPEN_SOURCE and _XOPEN_EXTENDED magic\n        # ... Solaris wants\n        #elif !defined(__APPLE__) && ...\n        # ... existing code\n        #endif\n"},{"id":"116074","messageId":"B96700A1-EC8C-4DDE-A158-CE298FCCA09F@dbservice.com","threadId":"19456","inReplyTo":"1243106697-6424-2-git-send-email-gitster@pobox.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-06-11T15:06:00Z","receivedAt":"2009-06-11T15:06:00Z","isPatch":true,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn May 23, 2009, at 9:24 PM, Junio C Hamano wrote:\n\n> In git-compat-util.h, we do\n>\n>    #define _XOPEN_SOURCE 600\n>    #define _XOPEN_SOURCE_EXTENDED 1\n>\n> unless we are on BSD or SCO.\n>\n> On OpenSolaris (200811), /usr/include/sys/feature_tests.h has this  \n> nice\n> table:\n>\n>    Feature Test Macro\t\t\t\t     Specification\n>    ------------------------------------------------  -------------\n>    _XOPEN_SOURCE                                         XPG3\n>    _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4\n>    _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2\n>    _XOPEN_SOURCE = 500                                   XPG5\n>    _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6\n>\n> Later in the same header, compilation with -c99 is made to fail if  \n> _XPG6 is\n> not set, like this:\n>\n>    #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && ! \n> defined(_XPG6))\n>    #error \"Compiler or options invalid for pre-UNIX 03 X/Open  \n> applications \\\n>            and pre-2001 POSIX applications\"\n>    #elif ...\n>\n> The problem is that they check things in an order that is  \n> inconvenient for\n> us.  When they see _XOPEN_SOURCE_EXTENDED, they declare that we are  \n> XPG4v2,\n> regardless of the value of _XOPEN_SOURCE.\n>\n> To work around this problem, do not define _XOPEN_SOURCE_EXTENDED on\n> Sun's.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> git-compat-util.h |    2 ++\n> 1 files changed, 2 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index c7cf2d5..4236647 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h\n> @@ -41,8 +41,10 @@\n>\n> #if !defined(__APPLE__) && !defined(__FreeBSD__)  && ! \n> defined(__USLC__) && !defined(_M_UNIX)\n> #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD  \n> needs 600 for S_ISLNK() */\n> +#ifndef __sun__\n> #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n> #endif\n> +#endif\n> #define _ALL_SOURCE 1\n> #define _GNU_SOURCE 1\n> #define _BSD_SOURCE 1\n> -- \n> 1.6.3.1.145.gb74d77\n>\n\nUntil this commit a simple 'make prefix=...' worked just fine. Now I  \nhave to explicitly add '-std=c99' to the gcc commandline. Is there a  \nreason why the makefile doesn't add this switch automatically?\n\ntom\n"},{"id":"116077","messageId":"bUVdoksYaP8iWWwjmEaaKuJWLMjhg9vaKu35QNnhoSMM0G7B3XoanQ@cipher.nrlssc.navy.mil","threadId":"19456","inReplyTo":"B96700A1-EC8C-4DDE-A158-CE298FCCA09F@dbservice.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-11T15:50:21Z","receivedAt":"2009-06-11T15:50:21Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Tomas Carnecky wrote:\n> \n> On May 23, 2009, at 9:24 PM, Junio C Hamano wrote:\n\n>> diff --git a/git-compat-util.h b/git-compat-util.h\n>> index c7cf2d5..4236647 100644\n>> --- a/git-compat-util.h\n>> +++ b/git-compat-util.h\n>> @@ -41,8 +41,10 @@\n>>\n>> #if !defined(__APPLE__) && !defined(__FreeBSD__)  &&\n>> !defined(__USLC__) && !defined(_M_UNIX)\n>> #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD\n>> needs 600 for S_ISLNK() */\n>> +#ifndef __sun__\n>> #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n>> #endif\n>> +#endif\n>> #define _ALL_SOURCE 1\n>> #define _GNU_SOURCE 1\n>> #define _BSD_SOURCE 1\n>> -- \n>> 1.6.3.1.145.gb74d77\n>>\n> \n> Until this commit a simple 'make prefix=...' worked just fine. Now I\n> have to explicitly add '-std=c99' to the gcc commandline. Is there a\n> reason why the makefile doesn't add this switch automatically?\n\nThere are additionally patches on 'next' and more in the pipeline on 'pu'\nwhich adjust these feature macros when compiling on Solaris.  See the\nbc/solaris series 8fccb00 which was merged to 'pu'.\n\nAlso, if you happen to be using the Sun Studio suite 12 with c-compiler\nversion 5.9, I'd be interested to know whether you can compile diff-delta.c,\nor whether you get an error (see commit 203ee91f).\n\n-brandon\n"},{"id":"116078","messageId":"7vmy8eiwy1.fsf@alter.siamese.dyndns.org","threadId":"19456","inReplyTo":"B96700A1-EC8C-4DDE-A158-CE298FCCA09F@dbservice.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-11T15:58:46Z","receivedAt":"2009-06-11T15:58:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tomas Carnecky <tom@dbservice.com> writes:\n\n> Until this commit a simple 'make prefix=...' worked just fine. Now I\n> have to explicitly add '-std=c99' to the gcc commandline. Is there a\n> reason why the makefile doesn't add this switch automatically?\n\nAn extended \"Solaris updates\" series has been cooking in 'next' branch, I\nthink, and does things a bit differently.\n\n4cb18a4 (git-compat-util.h: tweak the way _XOPEN_SOURCE is set on Solaris,\n2009-06-05) sets _XOPEN_SOURCE to 500 if you are not compiling with c99.\n"},{"id":"116079","messageId":"BDDDCC14-2EC0-4F34-AACE-0B0A3D8481B8@dbservice.com","threadId":"19456","inReplyTo":"bUVdoksYaP8iWWwjmEaaKuJWLMjhg9vaKu35QNnhoSMM0G7B3XoanQ@cipher.nrlssc.navy.mil","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-06-11T16:42:01Z","receivedAt":"2009-06-11T16:42:01Z","isPatch":true,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Jun 11, 2009, at 5:50 PM, Brandon Casey wrote:\n>\n> There are additionally patches on 'next' and more in the pipeline on  \n> 'pu'\n> which adjust these feature macros when compiling on Solaris.  See the\n> bc/solaris series 8fccb00 which was merged to 'pu'.\n\nAlright, just wanted to make sure that issue is known.\n\n> Also, if you happen to be using the Sun Studio suite 12 with c- \n> compiler\n> version 5.9, I'd be interested to know whether you can compile diff- \n> delta.c,\n> or whether you get an error (see commit 203ee91f).\n\n\nI happen to have access to some of my university's solaris boxes with  \nthe following compiler: Sun C 5.9 SunOS_sparc Patch 124867-02  \n2007/11/27, I hope that is good enough.\n\n$ gmake CC=/opt/SUNWspro/bin/c99 CFLAGS=\"\" OPENSSLDIR=/usr/sfw V=1  \ndiff-delta.o\nGIT_VERSION = 1.6.3.2.354.g5787c\n     * new build flags or prefix\n/opt/SUNWspro/bin/c99 -o diff-delta.o -c   -D__EXTENSIONS__ -D__sun__ - \nI/usr/sfw/include -DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRCASESTR - \nDNO_MKDTEMP -DNO_MKSTEMPS -DNO_MEMMEM diff-delta.c\n$ echo $?\n0\n\n(btw, I have to clear CFLAGS when compiling with the sun compiler, as  \nit doesn't understand -Wall)\n\ntom\n"},{"id":"116084","messageId":"UBftUjN2Jk2tj73et7i3WvuSUhtOiNjPVjmux6IKeXOo0Zs8KHgrOA@cipher.nrlssc.navy.mil","threadId":"19456","inReplyTo":"BDDDCC14-2EC0-4F34-AACE-0B0A3D8481B8@dbservice.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-11T17:13:51Z","receivedAt":"2009-06-11T17:13:51Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Tomas Carnecky wrote:\n> \n> On Jun 11, 2009, at 5:50 PM, Brandon Casey wrote:\n>>\n>> There are additionally patches on 'next' and more in the pipeline on 'pu'\n>> which adjust these feature macros when compiling on Solaris.  See the\n>> bc/solaris series 8fccb00 which was merged to 'pu'.\n> \n> Alright, just wanted to make sure that issue is known.\n> \n>> Also, if you happen to be using the Sun Studio suite 12 with c-compiler\n>> version 5.9, I'd be interested to know whether you can compile\n>> diff-delta.c,\n>> or whether you get an error (see commit 203ee91f).\n> \n> \n> I happen to have access to some of my university's solaris boxes with\n> the following compiler: Sun C 5.9 SunOS_sparc Patch 124867-02\n> 2007/11/27, I hope that is good enough.\n> \n> $ gmake CC=/opt/SUNWspro/bin/c99 CFLAGS=\"\" OPENSSLDIR=/usr/sfw V=1\n> diff-delta.o\n> GIT_VERSION = 1.6.3.2.354.g5787c\n>     * new build flags or prefix\n> /opt/SUNWspro/bin/c99 -o diff-delta.o -c   -D__EXTENSIONS__ -D__sun__\n> -I/usr/sfw/include -DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRCASESTR\n> -DNO_MKDTEMP -DNO_MKSTEMPS -DNO_MEMMEM diff-delta.c\n> $ echo $?\n> 0\n\nOk, great.  Looks like Sun fixed the flaw that was present in the 5.8\ncompiler, and no other changes need to be made to git.  To be absolutely\nsure, and if you have a moment, can you try to compile the code snippet at\nthe end of this email?\n\nIf you name the saved the code \"test.c\", then just compile with\n\n   /opt/SUNWspro/bin/c99 -c test.c\n\nThe Sun C 5.8 compiler complains like this for me:\n\n   \"test.c\", line 12: identifier redeclared: test_func\n           current : function(pointer to const struct a_struct {int b, array[-1] of pointer to char c}) returning pointer to void\n           previous: function(pointer to const struct a_struct {int b, array[-1] of pointer to char c}) returning pointer to void : \"test.c\", line 4\n   c99: acomp failed for test.c\n\nIf the 5.9 compiler successfully compiles it, then this new version of Sun's\ncompiler correctly handles c99 flex arrays.\n\n> (btw, I have to clear CFLAGS when compiling with the sun compiler, as it\n> doesn't understand -Wall)\n\nYes, that's correct.\n\n-brandon\n\n\n--->8--- test.c --->8---\nstruct a_struct;\n\nextern void *test_func(const struct a_struct *f);\n\nstruct a_struct {\n        int b;\n        char* c[];\n};\n\nvoid *test_func(const struct a_struct *f)\n{\n        return 0;\n}\n"},{"id":"116085","messageId":"4F909897-DD86-4C35-B18F-BE1CFBF06FAE@dbservice.com","threadId":"19456","inReplyTo":"UBftUjN2Jk2tj73et7i3WvuSUhtOiNjPVjmux6IKeXOo0Zs8KHgrOA@cipher.nrlssc.navy.mil","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-06-11T17:36:15Z","receivedAt":"2009-06-11T17:36:15Z","isPatch":true,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Jun 11, 2009, at 7:13 PM, Brandon Casey wrote:\n> Ok, great.  Looks like Sun fixed the flaw that was present in the 5.8\n> compiler, and no other changes need to be made to git.  To be  \n> absolutely\n> sure, and if you have a moment, can you try to compile the code  \n> snippet at\n> the end of this email?\n>\n> If you name the saved the code \"test.c\", then just compile with\n>\n>   /opt/SUNWspro/bin/c99 -c test.c\n>\n> The Sun C 5.8 compiler complains like this for me:\n>\n>   \"test.c\", line 12: identifier redeclared: test_func\n>           current : function(pointer to const struct a_struct {int  \n> b, array[-1] of pointer to char c}) returning pointer to void\n>           previous: function(pointer to const struct a_struct {int  \n> b, array[-1] of pointer to char c}) returning pointer to void :  \n> \"test.c\", line 4\n>   c99: acomp failed for test.c\n>\n> If the 5.9 compiler successfully compiles it, then this new version  \n> of Sun's\n> compiler correctly handles c99 flex arrays.\n\nIt compiles without errors.\n\ntom\n"},{"id":"116086","messageId":"e6q6-KAF9ZIUaT_O5z9c3VfQ-BLxFbFlWxTLMk2ZzCKPA2OOlxEhhw@cipher.nrlssc.navy.mil","threadId":"19456","inReplyTo":"4F909897-DD86-4C35-B18F-BE1CFBF06FAE@dbservice.com","subject":"Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-11T17:42:45Z","receivedAt":"2009-06-11T17:42:45Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Tomas Carnecky wrote:\n> \n> On Jun 11, 2009, at 7:13 PM, Brandon Casey wrote:\n>> Ok, great.  Looks like Sun fixed the flaw that was present in the 5.8\n>> compiler, and no other changes need to be made to git.  To be absolutely\n>> sure, and if you have a moment, can you try to compile the code\n>> snippet at\n>> the end of this email?\n>>\n>> If you name the saved the code \"test.c\", then just compile with\n>>\n>>   /opt/SUNWspro/bin/c99 -c test.c\n>>\n>> The Sun C 5.8 compiler complains like this for me:\n>>\n>>   \"test.c\", line 12: identifier redeclared: test_func\n>>           current : function(pointer to const struct a_struct {int b,\n>> array[-1] of pointer to char c}) returning pointer to void\n>>           previous: function(pointer to const struct a_struct {int b,\n>> array[-1] of pointer to char c}) returning pointer to void : \"test.c\",\n>> line 4\n>>   c99: acomp failed for test.c\n>>\n>> If the 5.9 compiler successfully compiles it, then this new version of\n>> Sun's\n>> compiler correctly handles c99 flex arrays.\n> \n> It compiles without errors.\n\nGreat.  Thanks.\n\n-brandon\n"}]}