Re: [AD] -Wno-unused

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Dustin Dettmer:
> According to my understanding, the correct way to achieve that is be not
> including the variable name.

> ie void foo(int*) { }
> instead of void foo(int *i) { }

> This stops the unused warnings under gcc 3.3+ and compiles correctly. I'm
> not sure if other compilers follow the same syntax though.

I don't think that is valid C. I get "parameter name omitted" error with
MinGW GCC 3.4.2. It works in C++, though. As I said in my other mail, GCC's
'unused' attribute will work. Example:

#ifdef __GNUC__
#   define AL_UNUSED __attribute__ ((__unused__))
#else
#   define AL_UNUSED /**/
#endif

int foo(int x, AL_UNUSED int y) { return x; }

--
Daniel Schlyder
http://bitblaze.com/





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/