[PATCH 19/23] rtems-rfs-buffer.c: Correct printf() format specifiers to eliminate warnings

Joel Sherrill joel.sherrill at oarcorp.com
Thu Sep 4 17:37:08 UTC 2014


On 9/4/2014 11:21 AM, Gedare Bloom wrote:
> On Wed, Sep 3, 2014 at 11:26 AM, Joel Sherrill
> <joel.sherrill at oarcorp.com> wrote:
>> ---
>>  cpukit/libfs/src/rfs/rtems-rfs-buffer.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c
>> index 3d89f5f..4192b21 100644
>> --- a/cpukit/libfs/src/rfs/rtems-rfs-buffer.c
>> +++ b/cpukit/libfs/src/rfs/rtems-rfs-buffer.c
>> @@ -52,13 +52,12 @@ rtems_rfs_scan_chain (rtems_chain_control*   chain,
>>      buffer = (rtems_rfs_buffer*) node;
>>
>>      if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
>> -      printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
>> +      printf ("%p ", buffer->user);
>>
>>      if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
>>      {
>>        if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
>> -        printf (": found block=%" PRIuPTR "\n",
>> -                ((intptr_t)(buffer->user)));
>> +        printf (": found block=%p\n", buffer->user);
> What is the warning this fixed? The "PRIuPTR" should be the right way
> to print an (unsigned) pointer. Perhaps changing the cast to
> (uintptr_t) would fix the warning?
Give me a few hours. I am not sure which architecture/BSP tripped this. I
reverted the patch locally but will need to build all to find it again.
>>        (*count)--;
>>        rtems_chain_extract_unprotected (node);
>> --
>> 1.9.3
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the devel mailing list