C++ Logo

std-discussion

Advanced search

Re: Undefining a compiler 's predefined macro

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sun, 22 Mar 2020 12:22:31 +0200
On Sun, 22 Mar 2020 at 12:12, Edward Diener via Std-Discussion
<std-discussion_at_[hidden]> wrote:
>
> Is it valid C++ to undefine a compiler's predefined macro ? According to
> the C++ standard, in 19.8.4:
>
> If any of the pre-defined macro names in this subclause, or the
> identifier defined, is the subject of a #define
> or a #undef preprocessing directive, the behavior is undefined.
>
> But if a compiler has a documented predefined macro which is not in the
> subclause is it valid C++ to undefine that macro, and must a C++
> standard conforming compiler allow it ?

No, and no. Do you have an example of such a macro? Do you think it's
valid to name it
in your program, considering http://eel.is/c++draft/lex.name#3 ?

Received on 2020-03-22 05:25:32