Last change
on this file since 373f098 was 58eb9250, checked in by Michael Brooks <mlbrooks@…>, 9 months ago |
Partly fix #269 and try to fix nightly build. Switch to correct type for polymorphic sizeof(-) on 32-bit.
|
-
Property mode
set to
100644
|
File size:
575 bytes
|
Line | |
---|
1 | // From fixed Trac #269
|
---|
2 |
|
---|
3 | forall( T )
|
---|
4 | void fred( T x ) {
|
---|
5 | printf( "%zu\n", sizeof(T) );
|
---|
6 | printf( "%zu\n", sizeof(x) );
|
---|
7 | (void) x; // FIX ME: work around Trac #300
|
---|
8 | }
|
---|
9 |
|
---|
10 | #include <array.hfa>
|
---|
11 | forall( [N] )
|
---|
12 | void mary( array(char, N) & ) {
|
---|
13 | printf( "%zu\n", N );
|
---|
14 | #if defined TRY_TRAC_269_REMAINDER
|
---|
15 | for ( i; N ) {
|
---|
16 | if (i > 0) printf(" ");
|
---|
17 | printf( "%zu", i); // FIX ME: i still getting type long unsigned int on -m32
|
---|
18 | }
|
---|
19 | printf("\n");
|
---|
20 | #endif
|
---|
21 | }
|
---|
22 |
|
---|
23 | int main() {
|
---|
24 | char c = 'x';
|
---|
25 | fred(c);
|
---|
26 |
|
---|
27 | array( char, 10 ) a;
|
---|
28 | mary(a);
|
---|
29 |
|
---|
30 | return 0;
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.