Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/designations.c

    ra04ce4d r62423350  
    99// Author           : Rob Schluntz
    1010// Created On       : Thu Jun 29 15:26:36 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 27 11:46:35 2017
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Thu Jun 29 15:27:05 2017
     13// Update Count     : 2
    1414//
    1515
     
    8989};
    9090
    91 struct Fred {
    92     double i[3];
    93     int j;
    94     struct Mary {
    95         struct Jane {
    96             double j;
    97         } j;
    98         double i;
    99     } m;
    100 };
    101 struct Fred s1 @= { .m.j : 3 };
    102 struct Fred s2 @= { .i : { [2] : 2 } };
    103 
    10491int main() {
    10592        // simple designation case - starting from beginning of structure, leaves ptr default-initialized (zero)
     
    212199        };
    213200#endif
    214         // array designation
    215         int i[2] = { [1] : 3 };
     201
    216202        // allowed to have 'too many' initialized lists - essentially they are ignored.
    217203        int i1 = { 3 };
     
    254240        const char * str0 = "hello";
    255241        char str1[] = "hello";
    256         const char c1[] = "abc";
    257         const char c2[] = { 'a', 'b', 'c' };
    258         const char c3[][2] = { { 'a', 'b' }, { 'c', 'd'}, { 'c', 'd'} };
    259242}
    260243
Note: See TracChangeset for help on using the changeset viewer.