C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [isocpp-ext] P2437R0 #warning (avoiding a diverging preprocessor)

From: Niall Douglas <s_sourceforge_at_[hidden]>
Date: Tue, 12 Oct 2021 13:11:20 +0000
On 12/10/2021 13:53, Aaron Ballman via Ext wrote:
> On Tue, Oct 12, 2021 at 8:48 AM Andrew Tomazos via Ext
> <ext_at_[hidden]> wrote:
>>
>> Oops. I missed that bit: MSVC doesn't support #warning ?
>
> Correct. They support something similar but under a different spelling:
>
> #pragma message("oh no")
>
> https://docs.microsoft.com/en-us/cpp/preprocessor/message?view=msvc-160
>
>> Why not? Did MSVC consider supporting #warning and then decided against
 it? What's the story there?
>
> Uncertain, but hopefully a Microsoft representative can say more if
> there's a problem with supporting this (and if there is, whether it's
> a problem for their C implementation as well).

I assume that the sequence of code points after #warning is to be
handled identically to how #error handles its sequence of codepoints?

I ask because #error is a touch broken with certain characters, which is
very annoying:

https://godbolt.org/z/MPWcYrhnv

I don't care if a special case is just made for ' when used inside
#error or #warning, but this has been a consistent gotcha since I first
started writing in C 25 years ago and I'd like it to go away please.

Niall

Received on 2021-10-12 08:11:23