Boost logo

Boost :

Subject: Re: [boost] [msvc] #warning preprocessor directive
From: Beman Dawes (bdawes_at_[hidden])
Date: 2017-10-17 16:17:10


On Tue, Oct 17, 2017 at 11:59 AM, Peter Dimov via Boost <
boost_at_[hidden]> wrote:

> Robert Ramey wrote:
>
>> personally I don't see any difference between #warning and the already
>> existing and portable #pragma message - which is what I use on a regular
>> basis.
>>
>
> `#pragma message("foo")` results in the following output:
>
> foo
>
> and shows nothing in the IDE warning list. So you either don't see it, or
> if you do, you have no clue where did it come from.
>
> `#warning foo` would result in the following output:
>
> source_file(source_line): warning C7563: #warning foo
>
> which would then be shown as a warning in the IDE.
>
> Yes, that's what make #warning more attractive.

There is a hack on Stackoverflow https://stackoverflow.com/questions/5966594
to use a macro cascade to solve the problem.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk