Counter-productive UNUSED macro in connectivity/source/drivers/postgresql

Tor Lillqvist tml at iki.fi
Thu Feb 9 00:04:10 PST 2012


In pq_common.hxx there is:

#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif

and then UNUSED is used like this (just in two places (so far, I guess
the intent is to use it more?)):

pointer allocate (size_type n, const void* UNUSED(hint) = 0)

Sure, it silences warnings from gcc. But MSVC still warns. We do want
to eventually be warning-free with MSVC, too, don't we? Don't we
already have a convention how to handle unused parameters in C++ code,
i.e. comment their name out?

--tml


More information about the LibreOffice mailing list