C++ Logo


Advanced search

Re: Undefining a compiler 's predefined macro

From: Andrew Schepler <aschepler_at_[hidden]>
Date: Sun, 22 Mar 2020 10:54:37 -0400
On Sun, Mar 22, 2020, 9:58 AM Edward Diener via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> The general reason, since you seem curious, is that the codebase has
> many instances of testing the predefined macro for one-off workarounds
> for the particular compiler, which was not C++ standard compliant in a
> number of cases.

The thing is, those tests are already a violation of the same rule, and
always were. That doesn't mean they were a bad idea, just that the Standard
calls the program non-conforming. If the point is to be as
Standard-compliant as possible, the #undef doesn't help. The only way to
get that type of compliance is to remove every one of those existing tests
(possibly replacing them with a different test).

Now in real life software, Standard compliance isn't the only
consideration, or always the most important one. Balancing that goal of
compliance against effort of changes, etc. is a business decision, not a
purely technical one.


Received on 2020-03-22 09:57:41