gdor11
gdor11

Reputation: 93

Should I use gcc or cc when programming in C?

I searched a little bit and one google search was enough to discover the differences between the gcc and cc compilers, but I did not find the advantages in using one or another to compile C programs

Which compiler should I use? and why?

Upvotes: 2

Views: 1953

Answers (1)

chqrlie
chqrlie

Reputation: 144520

The compiler installed as part of X-Code on OS/X is a recent version of clang whose development is sponsored by Apple.

gcc is not provided nor supported by Apple.

Unless you install gcc explicitly from one of its distributions, gcc is an alias for clang on OS/X, just like cc.

The reason for this is to support packages that use gcc explicitly as the C compiler.

On your system, it does not matter which alias you use, the compiler invoked will be clang, which has a high degree of compatibility with gcc extensions but generates different code. Both are very advanced and dependable.

Upvotes: 1

Related Questions