[Development] Order of macro expansion in compiler error messages

Thiago Macieira thiago.macieira at intel.com
Sat Dec 7 21:24:28 CET 2013


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
-------------- 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/20131207/a0801ad0/attachment.sig>


More information about the Development mailing list