Last change
on this file since 6f9f338 was d3d54b3, checked in by Michael Brooks <mlbrooks@…>, 8 months ago |
Eliminate warnings due to sizeof returning type inconsistent with %zu. Fix #269.
Test
nowarn/printf-sizeof
: Activate direct test of the bug.
Tests
alloc-ERROR
extension
array-collections/dimexpr-match-c-ERRS
: Accommodate incidental changes in error-message text or generated code.
|
-
Property mode
set to
100644
|
File size:
473 bytes
|
Rev | Line | |
---|
[58eb9250] | 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) & ) {
|
---|
[d3d54b3] | 13 | printf( "%zu\n", N );
|
---|
| 14 | for ( i; N ) {
|
---|
[58eb9250] | 15 | if (i > 0) printf(" ");
|
---|
[d3d54b3] | 16 | printf( "%zu", i);
|
---|
| 17 | }
|
---|
[58eb9250] | 18 | printf("\n");
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | int main() {
|
---|
| 22 | char c = 'x';
|
---|
| 23 | fred(c);
|
---|
| 24 |
|
---|
| 25 | array( char, 10 ) a;
|
---|
| 26 | mary(a);
|
---|
| 27 |
|
---|
| 28 | return 0;
|
---|
| 29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.