[Xcb] [PATCH] silence some compiler warnings in xcb/util-cursor

Niclas Zeising zeising at daemonic.se
Mon Aug 12 02:33:22 PDT 2013


On 08/12/13 09:08, Michael Stapelberg wrote:
> Hi Niclas,
> 
> Niclas Zeising <zeising at daemonic.se> writes:
>> Attached patch silences a few clang warnings in xcb/util-cursor.
>> Please CC me, I'm not subscribed.
> I merged the second hunk of that patch, but I think the first one should
> already be fixed with commit c7eff39a5fb3552de57e52f737ea7ae59b1ef895.
> 
> Can you confirm that?
> 

That fix is not complete or enough.  With a fresh clone checked out just
now, clang gives me the following warning:

  CC       libxcb_cursor_la-cursor.lo
In file included from cursor.c:41:
./cursor.h:44:1: warning: typedef requires a name [-Wmissing-declarations]
typedef struct xcb_cursor_context_t {
^~~~~~~
1 warning generated.

This goes on for all three files that include "cursor.h".

The issue is that in "cursor.h" you have:

typedef struct xcb_cursor_context_t { ... };
                                          ^
Which is missing a typedef name.  However, in "xcb_cursor.h" there is
already a typedef struct xcb_cursor_context_t xcb_cursor_context_t;.
"xcb_cursor.h" is included in "cursor.h" so the typedef already exists,
and there is no need to redo it at all in "cursor.h".  All you need to
do there is define the struct.

I hope my explanation is clear.
And as always, please CC me, I'm not subscribed (I should probably fix
that though).
Regards, and thanks for your time!
-- 
Niclas Zeising

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20130812/92af4098/attachment.pgp>


More information about the Xcb mailing list