IBM XL C/C++ error with client/smbspool.c

yaberger at ca.ibm.com yaberger at ca.ibm.com
Wed Aug 6 17:26:54 GMT 2008


Hi Volker

Well here is what work and what doesn't work using the testcase for have 
immmediate structure.
My suggested patch is also at the end of the mail. I've tested it AIX with 
XL C/C++ and on ubuntu 8.04 with gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)


==> cat test.c
#include <stdio.h>

typedef struct {unsigned x;} FOOBAR;
#define X_FOOBAR(x) ((FOOBAR) { x })
#define FOO_ONE X_FOOBAR(1)

int main()
{
        FOOBAR f = FOO_ONE;
        static const struct {
                FOOBAR y;
        } f2[] = {
                {FOO_ONE}
        };
        /*static const FOOBAR f3[] = {FOO_ONE};*/

        return 0;
}

==> cc /tmp/test.c
==> cat test.c
#include <stdio.h>

typedef struct {unsigned x;} FOOBAR;
#define X_FOOBAR(x) ((FOOBAR) { x })
#define FOO_ONE X_FOOBAR(1)

int main()
{
        FOOBAR f = FOO_ONE;
        static const struct {
                FOOBAR y;
        } f2[] = {
                {FOO_ONE}
        };
        static const FOOBAR f3[] = {FOO_ONE};

        return 0;
}

==> cc /tmp/test.c
"/tmp/test.c", line 15.37: 1506-221 (S) Initializer must be a valid 
constant expression.






Yannick Bergeron
yaberger at ca.ibm.com
Poste 7711



Volker Lendecke <Volker.Lendecke at SerNet.DE> 
2008-08-06 11:10
Please respond to
Volker.Lendecke at SerNet.DE


To
yaberger at ca.ibm.com
cc
samba-technical at lists.samba.org
Subject
Re: IBM XL C/C++ error with client/smbspool.c






On Tue, Aug 05, 2008 at 03:40:55PM -0400, yaberger at ca.ibm.com wrote:
> I had a discussion monday with Volker about another strange error I'm 
> getting on AIX but this one is probably only related to my compiler (IBM 

> XL C/C++ 10.1 and 8)

The weird thing is: Why does your compiler accept the
configure test for HAVE_IMMEDIATE_STRUCTURES?

Volker
[attachment "attajbvn.dat" deleted by Yannick Y Bergeron/Bromont/IBM] 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Solve-an-IBM-XL-C-C-compiler-error-encountered-in.patch
Type: application/octet-stream
Size: 896 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080806/2e37a224/0001-Solve-an-IBM-XL-C-C-compiler-error-encountered-in.obj


More information about the samba-technical mailing list