[cairo] Cairo 1.6 is imminent
Hakki Dogusan
dogusanh at tr.net
Thu Apr 10 00:59:31 PDT 2008
Hi,
Kalle Vahlman wrote:
> 2008/4/10, Carl Worth <cworth at cworth.org>:
>> On Wed, 09 Apr 2008 15:34:02 -0700, Mathieu Lacage wrote:
>> > Usually, making the function parameter un-named gets rid of the warning.
>> > i.e.,
>> >
>> > void my_function (const char *)
>> > {
>> > /* do stuff */
>> > }
>>
>>
>> Oh, very nice. That's actually quite clean too. I'll do that (after
>> 1.6).
>
> GCC also has a variable attribute "unused" (available at least since
> the 3-series) that does the trick, though not as cleanly of course.
> Seems like GCC 3.x doesn't allow unnamed parameters[1], so if that's a
> concern the attribute would be a better choice.
>
> [1] With '-Wall -Wunused-parameter' for both 3.3 and 3.4 I get this:
> wtest.c: In function `foo':
> wtest.c:2: error: parameter name omitted
>
wxWidgets uses following defines for undefined parameters:
from wx/include/wx/defs.h
/* Macro to cut down on compiler warnings. */
#if 1 /* there should be no more any compilers needing the "#else"
version */
#define WXUNUSED(identifier) /* identifier */
#else /* stupid, broken compiler */
#define WXUNUSED(identifier) identifier
#endif
/* some arguments are only used in debug mode, but unused in release one */
#ifdef __WXDEBUG__
#define WXUNUSED_UNLESS_DEBUG(param) param
#else
#define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
#endif
...
It helps self documenting too.
--
Regards,
Hakki Dogusan
More information about the cairo
mailing list