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

Andrew Gregory andrew.gregory.8 at gmail.com
Sun Feb 10 08:53:24 EST 2013


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


More information about the pacman-dev mailing list