[Development] Order of macro expansion in compiler error messages

Kurt Pattyn pattyn.kurt at gmail.com
Sun Dec 8 12:09:16 CET 2013


On 08 Dec 2013, at 12:00, development-request at qt-project.org wrote:

> Just a quick poll: which order do you think is more intuitive?
> 
> Option A:
> qobjectdefs.h:69:20: error: expected unqualified-id before ‘protected’
> #   define signals protected
>                    ^
> <stdin>:1:6: note: in expansion of macro ‘signals’
> 
> Option B:
> <stdin>:1:6: error: expected unqualified-id
> bool signals;
>     ^
> qobjectdefs.h:69:20: note: expanded from macro 'signals'
> #   define signals protected
>                   ^
To me option B is more comprehensive to me.

In the other example:

> 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); \
>                  ~~~~~~~~   ^~~~~~~~~~~~~~


I prefer option A.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131208/6d6a7d5d/attachment.html>


More information about the Development mailing list