Page MenuHome GnuPG

gtksecentry.[ch] warning fixes
Closed, ResolvedPublic

Description

Hi,
building gtksecmementry.c with

-Wall -Wformat -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra
-Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes
-Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2

showed several warnings which the attached patch fixes. Detailed comments on the
changes are in the patch header. Please apply.

Details

Version
0.7.5

Event Timeline

Any chance this gets applied?

werner added a subscriber: marcus.
werner added a subscriber: werner.

Marcus, please decide whether we should apply them. Afaics, the options are not
the standard ones we use. The strange G_GSIZE_FORMAT macros look strange, we
better cast to int or use "%zd". Using the unused attribute to mark unused args
is not portable; better we access them (void)foo;

Hi Werner,
the G_* stuff is from GLIB/GTK+ so for a GTK+ object it's what somebody would
expect. If you want to stay close to the rest of the pinentry coding style I'm
or course fine with that.

Does not look pretty.
I ask myself why glib does not implement its own printf functions to get rid of
such macros. I recently changed the gnupg code base to use the estream printf
functions which now allows us to use modern printf format specifiers. That is
much nicer than cluttering the code with casts or macros.

That's a fair point. However it's just not there in glibc (at least I couldn't
find it). But if that's the only offending part the first two hunks could just
be skipped.

We don't ship gtksecmementry any more so that is definitely no longer relevant.
Closing.