Best UNIX-compatible free C compiler for Windows or Mac

My son is about to start an introductory C programming module at Uni.  Tuition will use a command line UNIX C (not C++) compiler.

He wants to practice during the summer break using either a Windows PC or a Mac, but with a C compiler that is fully compatible with standard C, as used on UNIX, so he doesn't get confused with non-standard syntax, compiler directives or libraries.  This is a very basic course so something that lets him practice C language constructs without getting bogged down in other complexities is what he needs (provided it is compatible with standard C).

Can anyone recommend a good free compiler (command line, not GUI) and is he better off running it under Windows or on a Mac (which is, after all, UNIX under the skin).

Many thanks

Nigel
NAKBrooksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

evilrixSenior Software Engineer (Avast)Commented:
Gcc https://gcc.gnu.org
The Windows version is called MinGW  http://www.mingw.org

Gcc is the defecto compiler, which is installed by default in Linux. It's available on nearly every platform.
Dave BaldwinFixer of ProblemsCommented:
I agree with evilrix.  I have MinGW on this computer.
NAKBrooksAuthor Commented:
If we use Windows as a platform it will be Win 7 or 10 on 64-bit h/w so how do we feel about mingw-w64, rather than MinGW? Is it a standard C implementation, and does it support the standard C maths library (his course is C for maths)?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Dave BaldwinFixer of ProblemsCommented:
MinGW contains The Standard C compiler packaged for Windows.  On the download page http://sourceforge.net/projects/mingw/files/ , I do not see anything about 'mingw-w64'.  What I do see is mingw-get-setup.exe (86.5 kB) which is a program to get the rest of the compiler and whatever other files you want.  I'd suggest you get that and see if it provides everything you need.  If it doesn't, it will probably tell you where to find it.

Part of learning C programming like this is learning the procedures and methods.  This is not a one-step procedure or compiler.
evilrixSenior Software Engineer (Avast)Commented:
Also, on the Mac the standard command line compiler is Clang, which is a GCC compatible compiler. You can get this by installing xCode and the command line tools. You can also install GCC, which you choose is up to you as they both (more or less) behave the same (since Clang is designed to be compatible with GCC).

>> how do we feel about mingw-w64, rather than MinGW?
At this stage in his development (pardon the pun) I really wouldn't get too hung up over the architecture.  For the type of code he'll be writing he really won't need to know nor care whether it's a 32 bit or 64 bit compiler. This is super advanced stuff and is highly unlikely to even be covered in his course.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NAKBrooksAuthor Commented:
Many thanks for the advice.  As he currently has a MacBook I think we'll go for xCode/Clang for the C module.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.