2.1.3. --[no_]anachronisms

This option enables or disables anachronisms in C++.

Mode

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

Default

The default is --no_anachronisms.

Example

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.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential