Re: glib-genmarshal



Paul Pogonyshev said:
> Hi.
>
> I'm writing an application that uses GTK+ as GUI.  I've come to a
> problem though.  My program is compiled with many GCC's `-W...'
> options turned on (i.e. i want to get warnings about suspicious
> code places).  However, in marshallers i generate with
> `glib-genmarshal' I get warnings about `invocation_hint' parameter
> which is never used.  This is very annoying and i had to add some
> nasty hack into that directories' `Makefile.am'.
>
> Will you maybe accept this simple (untested) patch so that at least
> future versions of `glib-genmarshal' produce cleaner code?
>

i've found, and been annoyed by the same thing before.

perl uses the following in cases where parameters/varaibles are going to be
unused. it's code that under most circumstances gets compiled out, but
prevents the warnings.

/* gcc -Wall:
 * for silencing unused variables that are actually used most of the time,
 * but we cannot quite get rid of, such `ax' in PPCODE+noargs xsubs
 */
#define PERL_UNUSED_VAR(var) if (0) var = var

we use it quite extensively with gtk2-perl in similar situations where we have
parameters/variables forced upon us which we do not need.

i would suggest that the above, or something like it be placed in glib
somewhere as GLIB_UNUSED_VAR (provided there isn't already something like it)
and then glib-genmarshal (and other situations like it) could make use of the
macro to quite warnings as necessary. obviously it's not a big deal either
way, but i would

the (other) main use i would see for it would be in callbacks where not all of
the paramters are of interest to the developer.

-rm



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]