C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [+externe Mail+] Re: [isocpp-core] Ignorability of attributes: draft wording, and concern about __has_c_attribute

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 8 Feb 2023 22:39:01 +0200
On Wed, 8 Feb 2023 at 22:18, Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
>
> On Wed, 8 Feb 2023 at 21:57, Uecker, Martin via Liaison
> <liaison_at_[hidden]> wrote:
>
> > But testing for an attribute where then only syntax
> > is checked by the compiler seems completely useless
> > to me. I was asking for an example where this make
> > sense, because I could not come up with one.
> >
> > So is there one?
>
> Yes. Gasper Azman (pardon the lack of proper accentuations on s and z)
> explained it:
>
> You have 11 compilers, and one of them will just never report "I do
> useful things as a response to your attribute."
> You don't care, the 10 compilers cover your needs, and the 1 remaining
> one will be an oddball. Once you are confident
> that the 10 compilers do the useful thing and are not going to remove
> that functionality, and the oddball accepts
> your code, you remove the macrodetection of the attribute. (*)

Note also that yes, this can be done with an additional separate
macro, and with less haste,
and Gasper seemed to agree with that.

Received on 2023-02-08 20:39:14