[cfe-dev] Pragma message in Clang?

Matt Joiner anacrolix at gmail.com
Mon Sep 27 09:24:19 PDT 2010


Sorry I used the term "note" as that's the text GCC prepends, I wasn't
aware of internal Clang construct by that name.
Regardless of the machinery used, MSVC (and GCC to a lesser degree),
attempt to implement these messages as unconfrontational notices, they
don't generate alarm bells or macro pasting tracebacks.

On Tue, Sep 28, 2010 at 2:11 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Sep 27, 2010, at 5:58 AM, John McCall wrote:
>
>>
>> On Sep 27, 2010, at 7:33 AM, Michael Spencer wrote:
>>
>>> On Mon, Sep 27, 2010 at 2:24 AM, Matt Joiner <anacrolix at gmail.com> wrote:
>>>> Perhaps, but #pragma message is hijacking the warning machinery,
>>>> rather than generating a "note" as in GCC and MSVC. For code with many
>>>> such messages, this would be irritating. If "message" isn't
>>>> standardized however, I can understand your lack of interest in it.
>>>
>>> I originally tried to emit a note, but I couldn't get clang to print
>>> it. Implementing this was actually my first patch to clang, so I never
>>> tried to figure out exactly how to get that working.
>>
>> A note wouldn't be appropriate;  notes are always subordinate to other diagnostics.
>
> Right, GCC doesn't have a lot of structure or regularity to its diagnostics.  In clang, a "note" is always part of the diagnostic before it.  This is why trying to emit a note as the first diagnostic doesn't work.  If a note comes out after a warning that is disabled, the note is disabled as well.
>
> -Chris
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list