[vox-tech] gcc and quieting warnings

Micah J. Cowan micah at cowan.name
Fri Jun 2 13:00:16 PDT 2006


On Fri, Jun 02, 2006 at 12:27:38PM -0700, Bill Kendrick wrote:
> On Fri, Jun 02, 2006 at 11:53:43AM -0400, Peter Jay Salzman wrote:
> > I always use -W -Wall when I compile code.  However, sometimes, I want gcc
> > to ignore certain instances of a warning.  For example, in something like a
> > stub function, or a signal callback, or even an API function that doesn't
> > use all the parameters, like:
> > 
> >    JNIEXPORT void JNICALL
> >    Java_HelloWorld_print( JNIEnv *env, jobject obj )
> <snip>
> 
> It may be sufficient to simply not NAME the variables, e.g.:
> 
>   Java_HelloWorld_print(JNIEnv*, jobject)
>   ...

Unfortunately, C doesn't allow you to do that (C++ does...).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


More information about the vox-tech mailing list