Re: gamma warnings bug




"K. Richard Pixley" <rich@kyoto.noir.com> writes:

> On my system, (originally redhat-5.0), the usage of "gamma" to declare
> function arguments collides with /usr/include/mathcalls.h producing...
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/lib/glib/include -I/usr/X11R6/include -g -Wall -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Winline -Wpointer-arith -O6 -pipe -fstrength-reduce -fexpensive-optimizations -finline-functions -frerun-cse-after-loop -freg-struct-return -fnonnull-objects -c -fPIC -DPIC glemisc.c
> In file included from /usr/include/gtk/gtkcolorsel.h:30,
>                  from /usr/include/gtk/gtk.h:36,
>                  from glemisc.h:22,
>                  from glemisc.c:20:
> /usr/include/gtk/gtkpreview.h:128: warning: declaration of `gamma' shadows global declaration
> 
> I think those arguments should be renamed.

To my understanding, parameter names in function prototypes
are basically ignored. So there is no way that:

void            gtk_preview_set_gamma          (double           gamma);

Could shadow the global gamma() declaration. 

I'm inclined say you should either drop the -Wshadow, or ignore the
warning.  Generally, once you start adding warnings beyond -Wall, you
tend to get lots of warnings about things which aren't errors at all.

On the other hand, the name could be changed to _gamma, or gam,
but who knows if somebody would include a header file with functions
by those names? It seems like a bit of a lost cause.

Regards,
                                        Owen







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