[pacman-dev] [PATCH] Add format attributes to all required functions

Allan McRae allan at archlinux.org
Sun Feb 10 09:06:06 EST 2013


On 10/02/13 23:53, Andrew Gregory wrote:
> On Sun, 10 Feb 2013 16:51:52 +1000
> Allan McRae <allan at archlinux.org> wrote:
> 
>> Fixes all clang warnings with -Wformat-literal.
>>
>> Also, fix genuine formating issue discovered once adding these attributes
>> and add a cast to prevent a gcc warning.
>>
>> Signed-off-by: Allan McRae <allan at archlinux.org>
>> ---
> 
> Much better than all those pragmas!  I still get one error though:
> 
> util.c:874:41: error: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Werror,-Wformat]
>     pm_asprintf(&str, _("Packages (%d):"), alpm_list_count(targets));
>                                    ~~      ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> I believe that should be %zd
> 

Yes - I don't see these on i686.   Added to the patch on my working branch.

Allan




More information about the pacman-dev mailing list