On 10/10/2016 17:29, Stephan Bosch wrote:


Op 10-10-2016 om 17:16 schreef Michael Felt:
On 10/10/2016 14:59, Stephan Bosch wrote:


Op 10-10-2016 om 14:39 schreef Michael Felt:
On 10-Oct-16 06:45, Aki Tuomi wrote:
Does your build end at some particular point?
See **** DETAILS **** for in depth (I hope enough!) study/report.

Aki

I would guess this is not "c99" way...

It seems to fail on a C99 feature called Compound Literal (see http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf, Section 6.5.2.5).

It should be supported by AIX:

https://www.ibm.com/support/knowledgecenter/SSGH3R_13.1.3/com.ibm.xlcpp1313.aix.doc/language_ref/compound_literals.html

I have no idea why it would fail here.

Regards,

Stephan.

Well, if I had the budget to buy the latest version (version 13 is your doclink) - then maybe it would work for me. I do not have the resources to upgrade from v11. Sad day for me I guess.

Or lucky for me that "Compound Literal" is not used much - this is the first time I have run into it.

Well, older versions are supposed to support it too:

https://www.ibm.com/support/knowledgecenter/SSGH3R_11.1.0/com.ibm.xlcpp111.aix.doc/language_ref/compound_literals.html
As I said, or implied - reading the code was new - as actually, normally I saw the C89 way to do things.

I wrote a simple test for myself to come to grips on the syntax expected - nothing nested, but seems to be passing test #1

    +1  typedef struct {
    +2          char * p1;
    +3          char * p2;
    +4  } http_auth_param_t;
    +5
    +6  http_auth_param_t a[] =
    +7          { "a1", "a2",
    +8            "b1", "b2"
    +9  };
   +10
   +11  main()
   +12  {
   +13          http_auth_param_t b[] = {
   +14                  (http_auth_param_t) { .p1 = "c1" },
   +15                  (http_auth_param_t) { .p2 = "e2" }
   +16          };
   +17
   +18          printf("%s\n", a[0].p1);
   +19          printf("%s\n", b[1].p2);
   +20  }

returns:
!cc c99_comp_literal.c; ./a.out
a1
e2


Regards,

Stephan.

Reply via email to