Re: [RFC/PATCH 1/2] Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomas Carnecky wrote:
> 
> On Jun 11, 2009, at 5:50 PM, Brandon Casey wrote:
>>
>> There are additionally patches on 'next' and more in the pipeline on 'pu'
>> which adjust these feature macros when compiling on Solaris.  See the
>> bc/solaris series 8fccb00 which was merged to 'pu'.
> 
> Alright, just wanted to make sure that issue is known.
> 
>> Also, if you happen to be using the Sun Studio suite 12 with c-compiler
>> version 5.9, I'd be interested to know whether you can compile
>> diff-delta.c,
>> or whether you get an error (see commit 203ee91f).
> 
> 
> I happen to have access to some of my university's solaris boxes with
> the following compiler: Sun C 5.9 SunOS_sparc Patch 124867-02
> 2007/11/27, I hope that is good enough.
> 
> $ gmake CC=/opt/SUNWspro/bin/c99 CFLAGS="" OPENSSLDIR=/usr/sfw V=1
> diff-delta.o
> GIT_VERSION = 1.6.3.2.354.g5787c
>     * new build flags or prefix
> /opt/SUNWspro/bin/c99 -o diff-delta.o -c   -D__EXTENSIONS__ -D__sun__
> -I/usr/sfw/include -DSHA1_HEADER='<openssl/sha.h>'  -DNO_STRCASESTR
> -DNO_MKDTEMP -DNO_MKSTEMPS -DNO_MEMMEM diff-delta.c
> $ echo $?
> 0

Ok, great.  Looks like Sun fixed the flaw that was present in the 5.8
compiler, and no other changes need to be made to git.  To be absolutely
sure, and if you have a moment, can you try to compile the code snippet at
the end of this email?

If you name the saved the code "test.c", then just compile with

   /opt/SUNWspro/bin/c99 -c test.c

The Sun C 5.8 compiler complains like this for me:

   "test.c", line 12: identifier redeclared: test_func
           current : function(pointer to const struct a_struct {int b, array[-1] of pointer to char c}) returning pointer to void
           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
   c99: acomp failed for test.c

If the 5.9 compiler successfully compiles it, then this new version of Sun's
compiler correctly handles c99 flex arrays.

> (btw, I have to clear CFLAGS when compiling with the sun compiler, as it
> doesn't understand -Wall)

Yes, that's correct.

-brandon


--->8--- test.c --->8---
struct a_struct;

extern void *test_func(const struct a_struct *f);

struct a_struct {
        int b;
        char* c[];
};

void *test_func(const struct a_struct *f)
{
        return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]