synth flash dev fixes

Rutger Hofman rutger@cs.vu.nl
Wed Nov 19 21:06:00 GMT 2008


Andrew Lunn wrote:
>> @@ -106,7 +106,7 @@
>>            blocks = info.block_info[0].blocks;
>>          }
>>          for (j=0;j < info.num_block_infos; j++) {
>> -          diag_printf("INFO:\t block_size %d, blocks %d\n",
>> +          diag_printf("INFO:\t block_size %lu, blocks %u\n",
>>                        info.block_info[j].block_size,
>>                        info.block_info[j].blocks);
>>          }
> 
> Interesting. With this patch i get:
> 
> /home/lunn/eCos/anoncvs-clean/packages/devs/flash/synthv2/current/tests/flash2.c: In function 'cyg_user_start':
> /home/lunn/eCos/anoncvs-clean/packages/devs/flash/synthv2/current/tests/flash2.c:117: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'size_t'
> 
> Without the patch it compiles cleanly. 

The printf modifier for size_t is %zd, not %d or %ld or %u or %lu. More 
recent gcc's complain about size_t or ssize_t (which has the same modifier).

Rutger



More information about the Ecos-patches mailing list