[Development] Order of macro expansion in compiler error messages

Chris Colbert sccolbert at gmail.com
Sat Dec 7 21:38:39 CET 2013


In the first example, Option B contained more information than Option A, to
the point where Option A would leave me head-scratching for a while. In the
newer example, I also find the order of Option B to be more intuitive.


On Sat, Dec 7, 2013 at 3:24 PM, Thiago Macieira
<thiago.macieira at intel.com>wrote:

> On sábado, 7 de dezembro de 2013 15:03:26, Chris Colbert wrote:
> > Is there a line missing from Option A, just after the line for <stdin>?
>
> This specific compiler did not output anything for this case.
>
> That case was a misuse of a macro. Here's another example, where the
> problem
> is inside the macro.
>
> Option A:
> qmetatype.h:1785:43: error: conversion to ‘int’ from ‘uint {aka unsigned
> int}’
> may change the sign of the result
>          const int tNameLen = qstrlen(tName); \
>                                            ^
> qmetatype.h:1913:1: note: in expansion of macro
> ‘Q_DECLARE_METATYPE_TEMPLATE_2ARG’
>  Q_DECLARE_METATYPE_TEMPLATE_2ARG(QPair)
>  ^
>
> Option B:
> qmetatype.h:1913:1: error: implicit conversion changes signedness: 'uint'
> (aka
> 'unsigned int') to 'const int'
> Q_DECLARE_METATYPE_TEMPLATE_2ARG(QPair)
> ^
> qmetatype.h:1785:30: note: expanded from macro
> 'Q_DECLARE_METATYPE_TEMPLATE_2ARG'
>         const int tNameLen = qstrlen(tName); \
>                   ~~~~~~~~   ^~~~~~~~~~~~~~
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131207/6231c0fe/attachment.html>


More information about the Development mailing list