[cfe-dev] Pragma message in Clang?

Chris Lattner clattner at apple.com
Sun Sep 26 21:03:58 PDT 2010


On Sep 26, 2010, at 6:51 PM, Matt Joiner wrote:

> Hi, patch works. However using pragma message will generate a warning traceback:
> 
> data.c:447:1: warning: TODO: i need to do X
> TODO("i need to do X")
> ^
> In file included from data.c:1:
> In file included from ./data.h:2:
> In file included from ./types.h:3:
> ./utility.h:70:20: note: instantiated from:
> #define TODO(todo) MESSAGE("TODO: " todo)
>                   ^
> ./utility.h:68:22: note: instantiated from:
> #define MESSAGE(msg) MESSAGE2(message(msg))
>                     ^
> ./utility.h:67:25: note: instantiated from:
> #define MESSAGE2(pslit) _Pragma(#pslit)
>                        ^
> <scratch space>:237:2: note: instantiated from:
> message("TODO: " "i need to do X")
> ^
> 
> Where GCC only generates a single line:
> data.c:447: note: #pragma message: TODO: i need to do X

I think that this is a feature, not a bug.  Making all the diagnostics consistent is good for simplicity of the code.

-Chris



More information about the cfe-dev mailing list