Index: libcfa/src/containers/array.hfa
===================================================================
--- libcfa/src/containers/array.hfa	(revision b9dae14c8dda6106bfff9679df8e3614bfe25d02)
+++ libcfa/src/containers/array.hfa	(revision 58c671ba7ef27f5b3d46954e88fa2ab452348c2c)
@@ -21,26 +21,48 @@
     };
 
-    Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, ptrdiff_t i ) {
+    // About the choice of integral types offered as subscript overloads:
+    // Intent is to cover these use cases:
+    //    float foo( ptrdiff_t i ) { return a[i]; }           // i : ptrdiff_t
+    //    forall( [N] ) ... for( i; N ) { total += a[i]; }    // i : typeof( sizeof(42) )
+    //    for( i; 5 ) { total += a[i]; }                      // i : int
+    // It gets complicated by:
+    // -  CFA does overloading on concrete types, like int and unsigned int, not on typedefed
+    //    types like size_t.  So trying to overload on ptrdiff_t vs int works in 64-bit mode
+    //    but not in 32-bit mode.
+    // -  Given bug of Trac #247, CFA gives sizeof expressions type unsigned long int, when it
+    //    should give them type size_t.
+    //    
+    //                          gcc -m32         cfa -m32 given bug         gcc -m64
+    // ptrdiff_t                int              int                        long int
+    // size_t                   unsigned int     unsigned int               unsigned long int
+    // typeof( sizeof(42) )     unsigned int     unsigned long int          unsigned long int
+    // int                      int              int                        int
+
+    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, int i ) {
         return (Timmed &) a.strides[i];
     }
 
-    Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, int i ) {
+    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
         return (Timmed &) a.strides[i];
     }
 
-    Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, size_t i ) {
+    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, long int i ) {
         return (Timmed &) a.strides[i];
     }
 
-    size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) {
+    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
+        return (Timmed &) a.strides[i];
+    }
+
+    static inline size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) {
         return z(N);
     }
 
     // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa)
-    void ?{}( arpk(N, S, Timmed, Tbase) & this ) {
+    static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) {
         void ?{}( S (&inner)[z(N)] ) {}
         ?{}(this.strides);
     }
-    void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
+    static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
         void ^?{}( S (&inner)[z(N)] ) {}
         ^?{}(this.strides);
@@ -53,8 +75,8 @@
 
 forall( Te )
-Te mkar_( tag(Te) ) {}
+static inline Te mkar_( tag(Te) ) {}
 
 forall( [N], ZTags ... , Trslt &, Tatom & | { Trslt mkar_( tag(Tatom), ZTags ); } )
-arpk(N, Trslt, Trslt, Tatom) mkar_( tag(Tatom), tag(N), ZTags ) {}
+static inline arpk(N, Trslt, Trslt, Tatom) mkar_( tag(Tatom), tag(N), ZTags ) {}
 
 // based on https://stackoverflow.com/questions/1872220/is-it-possible-to-iterate-over-arguments-in-variadic-macros
@@ -90,5 +112,5 @@
 
 forall( TA &, TB &, TC &, IxAB, IxBC ... | { TB & ?[?]( TA &, IxAB ); TC & ?[?]( TB &, IxBC ); } )
-TC & ?[?]( TA & this, IxAB ab, IxBC bc ) {
+static inline TC & ?[?]( TA & this, IxAB ab, IxBC bc ) {
     return this[ab][bc];
 }
@@ -99,15 +121,15 @@
 
 forall( TA &, TB &, TC &, IxAB_0, IxBC | { TB & ?[?]( TA &, IxAB_0 ); TC & ?[?]( TB &, IxBC ); } )
-TC & ?[?]( TA & this, IxAB_0 ab, IxBC bc ) {
+static inline TC & ?[?]( TA & this, IxAB_0 ab, IxBC bc ) {
     return this[ab][bc];
 }
 
 forall( TA &, TB &, TC &, IxAB_0, IxAB_1, IxBC | { TB & ?[?]( TA &, IxAB_0, IxAB_1 ); TC & ?[?]( TB &, IxBC ); } )
-TC & ?[?]( TA & this, IxAB_0 ab0, IxAB_1 ab1, IxBC bc ) {
+static inline TC & ?[?]( TA & this, IxAB_0 ab0, IxAB_1 ab1, IxBC bc ) {
     return this[[ab0,ab1]][bc];
 }
 
 forall( TA &, TB &, TC &, IxAB_0, IxAB_1, IxAB_2, IxBC | { TB & ?[?]( TA &, IxAB_0, IxAB_1, IxAB_2 ); TC & ?[?]( TB &, IxBC ); } )
-TC & ?[?]( TA & this, IxAB_0 ab0, IxAB_1 ab1, IxAB_2 ab2, IxBC bc ) {
+static inline TC & ?[?]( TA & this, IxAB_0 ab0, IxAB_1 ab1, IxAB_2 ab2, IxBC bc ) {
     return this[[ab0,ab1,ab2]][bc];
 }
@@ -121,14 +143,14 @@
 // Base
 forall( [Nq], [Sq], Tbase & )
-tag(arpk(Nq, Sq, Tbase, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(Tbase) ) {}
+static inline tag(arpk(Nq, Sq, Tbase, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(Tbase) ) {}
 
 // Rec
 forall( [Nq], [Sq], [N], [S], recq &, recr &, Tbase & | { tag(recr) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(recq) ); } )
-tag(arpk(N, S, recr, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(arpk(N, S, recq, Tbase)) ) {}
+static inline tag(arpk(N, S, recr, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(arpk(N, S, recq, Tbase)) ) {}
 
 // Wrapper
 struct all_t {} all;
 forall( [N], [S], Te &, result &, Tbase & | { tag(result) enq_( tag(Tbase), tag(N), tag(S), tag(Te) ); } )
-result & ?[?]( arpk(N, S, Te, Tbase) & this, all_t ) {
+static inline result & ?[?]( arpk(N, S, Te, Tbase) & this, all_t ) {
     return (result&) this;
 }
