[Development] Dropping the variadic version of QSKIP

Thiago Macieira thiago.macieira at intel.com
Wed Jul 10 18:46:48 CEST 2013

On quarta-feira, 10 de julho de 2013 15.09.41, Albert Astals Cid wrote:
> Hi all, in 14cd2678396ed1450a72aeffa99c1504743ea415 a variadic version of
> QSKIP was added so that the old Qt4 version of
>    QSKIP(statement, mode)
> would compile on C++11 enabled compilers silently ignoring the mode.
> This has a down side, it is causing that code like
>    QSKIP("HOLA");
> gives
>   warning: ISO C99 requires rest arguments to be used [enabled by default]
> when compiled with -pedantic and C++11
> Furthermore, things like
>   QSKIP("HOLA", SkipSingle);
> don't compile anymore because moc complains
>   main.cpp:11: Error: Macro argument mismatch.
> So it doesn't seem it makes much sense to keep the variadic version of QSKIP
> to enable the compatibility with the old Qt4 syntax if moc is not accepting
> it anymore.
> Would you guys accept a patch that drops the variadic version of QSKIP?

Well, there is a moc bug in the parsing of variadic macros, evidently.

Is there any way we can use the rest arguments without making them take effect? 
Such as by making a string out of them that doesn't get used anywhere:

#define QSKIP(x, ...)
 { static const char _[] = #__VA_ARGS__; } \
 [existing code]
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130710/033c9e0e/attachment.sig>

More information about the Development mailing list