[Development] Variadic Macros in Qt? - Re: QLog ( Work on qDebug and friends)

Jedrzej Nowacki jedrzej.nowacki at nokia.com
Wed Feb 15 09:21:21 CET 2012


On Wednesday 15. February 2012 02.00.35 ext Lincoln Ramsay wrote:
> On 02/14/2012 08:22 PM, Koehne Kai (Nokia-MP/Berlin) wrote:
> > Just wanted to point out that there are variadic macros
> 
> I'm aware of this but last time I checked, they weren't in the C++
> standard. It seems they're new to C99 and C++11. Grepping over the Qt 5
> sources reveals no variadic macros in Qt, though a few exist in third
> party bundled code.
> 
> I'm not in a position to say "we can use variadic macros in QtCore"
> which is why I didn't actually try to do that.
> 
> If someone who knows about supported platforms and variadic macro
> support in compilers can clarify that we can use variadic macros in Qt,
> then we can see if we can actually use variadic macros to differentiate
> between:
> 
> qDebug("message");
> qDebug() << "message";
> qDebug(CAT) << "message";
> 
> Where the last one expands to if (do_nothing); else debug()

Hi,

Usage of variadic macro was removed from Qt, It was causing compilation 
failure of a code compiled with --ansi -werror.

It was discussed here: http://lists.qt-project.org/pipermail/development/2011-
November/000348.html

Cheers,
  Jędrek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120215/f3dabd37/attachment.html>


More information about the Development mailing list