I am aware that on most GNU/Linux systems, GCC can be invoked by the name "cc" from the command line (as opposed to "gcc"). Is there any difference in GCC's behavior when it is invoked one way versus the other?
For example, I know that invoking GCC through the name "g++" instead of "gcc" causes GCC to behave differently (it treats .c files as C++ source and links-in the C++ standard library). Is there any similar difference in behavior between "gcc" versus "cc"?
EDIT: None of the answers received so far gave a definitive "yes" or "no" as to whether GCC will behave differently if invoked one way versus the other. However, the idea given to dive into the source to check its behavior lead me down that path. Based upon what I found there, I now believe that the answer is:
No. GCC behaves the same regardless of whether it is called via "gcc" or "cc".
For grins, I just traced down how argv[0]
is used from within gcc (main.c
-> top_lev.c
-> opts.c
-> langhooks.c
) and it appears that argv[0]
is currently used for nothing more than giving malloc
something to report when it fails. There doesn't appear to be any behavior change if argv[0]
is anything other than gcc
.