[PATCH 1/2] Using inttypes macros fixes 4 format warnings

Joel Sherrill joel at rtems.org
Fri Apr 7 21:00:05 UTC 2017


Thanks!

I just went ahead and pushed these. Testing will
hopefully occur over the weekend.

Good eye for going for a file with a lot of warnings. :)

--joel

On Fri, Apr 7, 2017 at 3:29 PM, Joel Sherrill <joel at rtems.org> wrote:

> I'm OK with both these patches but not in a good
> position to apply them right now.
>
> Gedare/Chris.. can you apply these?
>
> Thanks.
>
> --joel
>
> On Fri, Apr 7, 2017 at 9:11 AM, Cillian O'Donnell <cpodonnell8 at gmail.com>
> wrote:
>
>> ---
>>  cpukit/libdl/rtl-obj-cache.c | 21 ++++++++++++---------
>>  1 file changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/cpukit/libdl/rtl-obj-cache.c b/cpukit/libdl/rtl-obj-cache.c
>> index a4676cf..c859f60 100644
>> --- a/cpukit/libdl/rtl-obj-cache.c
>> +++ b/cpukit/libdl/rtl-obj-cache.c
>> @@ -22,6 +22,7 @@
>>  #include <stdio.h>
>>  #include <string.h>
>>  #include <unistd.h>
>> +#include <inttypes.h>
>>
>>  #include <rtems/rtl/rtl-allocator.h>
>>  #include "rtl-obj-cache.h"
>> @@ -78,11 +79,12 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache_t*
>> cache,
>>    struct stat sb;
>>
>>    if (rtems_rtl_trace (RTEMS_RTL_TRACE_CACHE))
>> -    printf ("rtl: cache: %2d: fd=%d offset=%d length=%d area=[%d,%d]
>> cache=[%d,%d] size=%d\n",
>> -            fd, cache->fd, (int) offset, (int) *length,
>> -            (int) offset, (int) offset + *length,
>> -            (int) cache->offset, (int) cache->offset + cache->level,
>> -            (int) cache->file_size);
>> +    printf ("rtl: cache: %2d: fd=%d offset=%" PRIdMAX "length=%zu
>> area=[%"
>> +            PRIdMAX ",%" PRIdMAX "] cache=[%" PRIdMAX ",%" PRIdMAX "]
>> size=%zu\n",
>> +            fd, cache->fd, offset, *length,
>> +            offset, offset + *length,
>> +            cache->offset, cache->offset + cache->level,
>> +            cache->file_size);
>>
>>    if (*length > cache->size)
>>    {
>> @@ -172,10 +174,11 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache_t*
>> cache,
>>      }
>>
>>      if (rtems_rtl_trace (RTEMS_RTL_TRACE_CACHE))
>> -      printf ("rtl: cache: %2d: seek: offset=%d buffer_offset=%d read=%d
>> cache=[%d,%d] dist=%d\n",
>> -              fd, (int) offset + buffer_offset, (int) buffer_offset,
>> (int) buffer_read,
>> -              (int) offset, (int) offset + buffer_read,
>> -              (int) (cache->file_size - offset));
>> +      printf ("rtl: cache: %2d: seek: offset=%" PRIdMAX
>> "buffer_offset=%zu"
>> +              "read=%zu cache=[%" PRIdMAX ",%" PRIdMAX "] dist=%"
>> PRIdMAX "\n",
>> +              fd, offset + buffer_offset, buffer_offset, buffer_read,
>> +              offset, offset + buffer_read,
>> +              (cache->file_size - offset));
>>
>>      if (lseek (fd, offset + buffer_offset, SEEK_SET) < 0)
>>      {
>> --
>> 2.7.4
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170407/34a83c8a/attachment-0002.html>


More information about the devel mailing list