EionRobb / skype4pidgin

Skype Plugin for Pidgin, libpurple and more
https://github.com/EionRobb/skype4pidgin/tree/master/skypeweb#skypeweb-plugin-for-pidgin
624 stars 88 forks source link

Fix printf warnings #621

Closed basicmaster closed 5 years ago

EionRobb commented 6 years ago

Is %zu valid on win32?

basicmaster commented 6 years ago

Yes. This conversion specifier is part of the C language itself and therefore platform-independent. See the z column/u row combination in the big table at https://en.cppreference.com/w/c/io/fprintf referring to size_t.

EionRobb commented 6 years ago

skypeweb_contacts.c:619:2: error: unknown conversion type character 'z' in format [-Werror=format] skypeweb_contacts.c:619:2: error: unknown conversion type character 'z' in format [-Werror=format]

EionRobb commented 6 years ago

Using G_GSIZE_FORMAT instead seems to work better for me on win32, does that work on Linux?

basicmaster commented 6 years ago

Hmm...what compiler (version) do you use? According to the docs, z requires at least C99. Maybe it has to be enabled explicitely.

I haven't tried G_GSIZE_FORMAT, but also if it worked, it may be by chance only - in contrast to the platform-agnostic z.

EionRobb commented 6 years ago

Ah, mingw32 is only c89

basicmaster commented 6 years ago

Have you considered moving to MinGW64 (in contrast to its name, it is available for 32 and 64 bit)?? I guess this won't be the last time that issues occur due to only C89 support ;-)

EionRobb commented 6 years ago

Pidgin 2.x is still built with minw32 so for now we'll stick with it :)

basicmaster commented 6 years ago

OK, I see :-)

So a workaround is required to address this limitation. I just added it the code. On Linux, it works as expected, without warnings.

basicmaster commented 5 years ago

@EionRobb Is there any update here in the meantime?

EionRobb commented 5 years ago

Sorry for the delay merging this :(

Thanks for the contribution!