[Xcb] [PATCH] cursor: Fix issue with gcc

Kristoffer Grönlund krig at koru.se
Mon Apr 25 08:45:17 UTC 2016


Hi,

On Sun, Apr 24, 2016 at 8:47 PM, Uli Schlachter <psychon at znc.in> wrote:
> CC'ing Michael Stapelberg, since this is "mostly his library".
>
> Am 21.04.2016 um 17:45 schrieb Stefan Dirsch:
>> From: Kristoffer Grönlund <krig at koru.se>
>>
>> cursor_shape_to_id should not be declared const, else it is not added
>> to the static library.
>
> Huh? Why not? What does GCC do different for static libraries? What does GCC
> even have to do with libraries at all (instead of e.g. the linker)? What does
> "not addeed to the static library" mean? What exactly are you doing and what's
> the error message?
>
> (Note that static libraries contain .o files and not functions...)
>
> Also: "Fix issue with gcc": Sorry, but my gcc works fine here, could you be more
> specific.

I wish I could, but I created that patch in 2013 and I no longer have
any memory nor any local trace of what version of GCC I was using. My
guess however is that it is a more recent version of GCC than what you
are using.

Here's my wild guess as to what was going on: If all parameters to the
function are const and the return value is also const, it seems that
at least on the OBS at that time, GCC would decide to inline the
function out of existence, which led to the linker complaining that
the function doesn't exist.

I think that I encountered this while building awesome [1], if that helps.

[1]: https://awesome.naquadah.org/

Cheers,
Kristoffer


More information about the Xcb mailing list