7.5 --anachronisms, --no_anachronisms

Enables and disables anachronisms in C++.


This option is effective only if the source language is C++.


The default is --no_anachronisms.


typedef enum { red, white, blue } tricolor;
inline tricolor operator++(tricolor c, int)
    int i = static_cast<int>(c) + 1;
    return static_cast<tricolor>(i);
void foo(void)
    tricolor c = red;
    c++; // okay
    ++c; // anachronism
Compiling this code with the option --anachronisms generates a warning message.
Compiling this code without the option --anachronisms generates an error message.
Related reference
7.25 --cpp
7.156 --strict, --no_strict
7.157 --strict_warnings
10.8 Anachronisms in ARM C++
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.