They are just flag names. It's better to avoid calling anything just "ANSI" because 1. they standardize so many things, 2. old standards are updated regularly with meaningful changes, and 3. they don't have particular involvement in any computer languages I'm aware of, but rather participate as a member of some international organization, in the case of C++, ISO.
When telling a compiler what standardized language dialect you want, specify the year of its standardization, or the only assumption it can make is that you want the first (oldest) standard. The initial standardization is the only point in time when failing to specify the year doesn't result in ambiguity.
Speaking of ambiguity, according to the documentation, -ansi
is the only language flag whose meaning depends on the invocation of GCC. gcc -ansi
means C89, and g++ -ansi
means C++03. Personally I prefer less ambiguity over more cleverness.