[PATCH weston v2] clients/stacking: Silence a compiler warning

Armin Krezović krezovic.armin at gmail.com
Wed Sep 28 19:56:00 UTC 2016


On 27.09.2016 15:56, Eric Engestrom wrote:
> On Tue, Sep 27, 2016 at 12:35:55PM +0200, Armin Krezović wrote:
>> This patch fixes a compiler warning when building with
>> clang, since it doesn't support gnu_printf attribute.
>>
>> v2:
>>
>>  - Switch to WL_PRINTF per suggestion from Eric Engestrom.
>>
>> Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
>> ---
> 

Hi Eric.

> Right now you get the WL_PRINTF macro because clients/stacking.c
> includes "window.h", which includes "shared/platform.h", which includes
> <wayland-egl.h>, which internally ends up including "wayland-util.h".
> 

Makes sense.

> It would be better to directly include wayland-util.h in this file,
> making the fragile include-chain irrelevant and making it explicit that
> you use something in this file.
> 
> With that #include added, this is:
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> 

Thanks.

> Cheers!
> 
>>  clients/stacking.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/clients/stacking.c b/clients/stacking.c
>> index 4285a17..7c711e4 100644
>> --- a/clients/stacking.c
>> +++ b/clients/stacking.c
>> @@ -184,7 +184,7 @@ fullscreen_handler(struct window *window, void *data)
>>  
>>  static void
>>  draw_string(cairo_t *cr,
>> -            const char *fmt, ...) __attribute__((format (gnu_printf, 2, 3)));
>> +            const char *fmt, ...) WL_PRINTF(2,3);
>>  
>>  static void
>>  draw_string(cairo_t *cr,
>> -- 
>> 2.10.0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 837 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160928/94e0f684/attachment.sig>


More information about the wayland-devel mailing list