This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch]: Fixes warnings in gthr-win32.h for mingw targets
Kai Tietz wrote:
> As there are no objections committed at revision 151077 to trunk.
No objection, but I'm curious about a couple of questions:
> +#ifndef __UNUSED_PARAM
> +#define __UNUSED_PARAM(x) x
> +#endif
Where else does UNUSED_PARAM get defined? I couldn't find it by grepping.
> -__gthread_objc_condition_allocate (objc_condition_t condition)
> +__gthread_objc_condition_allocate (objc_condition_t __UNUSED_PARAM(condition))
So presumably it's getting just #defined to nothing, and that means that the
parameter name gets omitted? Isn't that a C++ only syntax? Are you not using
gcc attributes because this might have to be compiled during stage 1 with a
non-gcc compiler (but then why does __gthread_key_create use attribute unused)?
I ask because I'm wondering if it might be more portable to do something
like this instead:
> +#ifndef __UNUSED_PARAM
> +#define __UNUSED_PARAM(x) x = x
> +#endif
> /* Allocate a condition. */
> int
> __gthread_objc_condition_allocate (objc_condition_t condition)
> {
> /* Unimplemented. */
> + __UNUSED_PARAM(condition);
> return -1;
> }
cheers,
DaveK