[SSSD] [PATCH] tests: Use right format string for type size_t

Michal Židek mzidek at redhat.com
Fri Oct 25 17:27:16 UTC 2013


On 10/25/2013 07:18 PM, Lukas Slebodnik wrote:
> ehlo,
>
> I found few warnings in current master. (I compile with Werror)
>
> src/tests/cmocka/test_utils.c:54:56: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          dom->name = talloc_asprintf(dom, DOMNAME_TMPL, c);
>                                                         ^
> src/tests/cmocka/test_utils.c:57:62: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          dom->flat_name = talloc_asprintf(dom, FLATNAME_TMPL, c);
>                                                               ^
> src/tests/cmocka/test_utils.c:60:57: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          dom->domain_id = talloc_asprintf(dom, SID_TMPL, c);
>                                                          ^
> src/tests/cmocka/test_utils.c:111:69: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          name = talloc_asprintf(global_talloc_context, DOMNAME_TMPL, c);
>                                                                      ^
> src/tests/cmocka/test_utils.c:114:75: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          flat_name = talloc_asprintf(global_talloc_context, FLATNAME_TMPL, c);
>                                                                            ^
> src/tests/cmocka/test_utils.c:117:64: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          sid = talloc_asprintf(global_talloc_context, SID_TMPL, c);
>                                                                 ^
> src/tests/cmocka/test_utils.c:155:69: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          name = talloc_asprintf(global_talloc_context, DOMNAME_TMPL, c);
>                                                                      ^
> src/tests/cmocka/test_utils.c:158:75: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          flat_name = talloc_asprintf(global_talloc_context, FLATNAME_TMPL, c);
>                                                                            ^
> src/tests/cmocka/test_utils.c:161:64: warning: format specifies type 'unsigned int' but the
>        argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>          sid = talloc_asprintf(global_talloc_context, SID_TMPL, c);
>
> Simple patch is attached.
>
> LS
>
>

The patch silenced the warnings for me.

ACK.

Michal




More information about the sssd-devel mailing list