cc language dialect

Hello the list,

When using clang as cc, we are finding that a lot of programs rely on the fact that c99 is a c99 compiler, and cc is a c89 compiler. Presumably we also don't want c99 to default to c11 when we make clang default to c11. I added a little hack to driver.cpp to select a default dialect based on the invocation name, but:

- Is this generally useful (POSIX says people should stop using cc in 1997 and it seems to be gone from the latest version of the spec)
- If so, is driver.cpp the correct place to do it?

David

Hello the list,

When using clang as cc, we are finding that a lot of programs rely on
the fact that c99 is a c99 compiler, and cc is a c89 compiler.
Presumably we also don't want c99 to default to c11 when we make
clang default to c11. I added a little hack to driver.cpp to select
a default dialect based on the invocation name, but:

- Is this generally useful (POSIX says people should stop using cc in
1997 and it seems to be gone from the latest version of the spec)

I support this change. It will make porting easier if 'cc' (or
anything with that suffix) defaults to c89/c90.

-Hal

> Hello the list,
>
> When using clang as cc, we are finding that a lot of programs rely on
> the fact that c99 is a c99 compiler, and cc is a c89 compiler.
> Presumably we also don't want c99 to default to c11 when we make
> clang default to c11. I added a little hack to driver.cpp to select
> a default dialect based on the invocation name, but:
>
> - Is this generally useful (POSIX says people should stop using cc in
> 1997 and it seems to be gone from the latest version of the spec)

I support this change. It will make porting easier if 'cc' (or
anything with that suffix) defaults to c89/c90.

I vote for it as well. I believe this is a source of problems on Solaris.

I don't think that's the case. From my experience, they depend on cc to
implement the semi-broken GNU inline semantic, but otherwise don't have
a problem with a c99 compiler. That's an important difference.

Joerg