4 ms·
Is there any particular reason people would go out of their way to use gcc on macOS? It comes with clang/llvm, which seem adequate.
by jeffbee 6y ago
Is there any particular reason people would go out of their way to use gcc on macOS? It comes with clang/llvm, which seem adequate.
- tyingq 6y agoSome specific pieces of C++ support that Clang is missing: Edit: newer link: https://clang.llvm.org/cxx_status.html https://clang.llvm.org/cxx_status.html (older link, not applicable, was here) Cross compiling for some embedded architectures. Things like FORTRAN or Ada, calling routines built there from C (or vice versa), etc.
- 1over137 6y agomacOS does not come with llvm/clang, you have to download Xcode, which you can't do anonymously, you need to create an account with Apple. Ages ago, macOS did actually come with gcc.
- jeffbee 6y agoYou can install the toolchain with `xcode-select` which does not require an Apple ID.
- kitsunesoba 6y agoAnd if I'm not mistaken, until clang is installed commands like "clang" and "gcc" redirect to xcode-select, so if the user tries to compile something the system will offer to install the toolchain for you.
- jeffbee 6y agoYep. That's how I setup a new Mac. I open a terminal and type `make` and it installs the world.
- voldacar 6y agogcc usually produces slightly faster O3 binaries
- Rebelgecko 6y agoI've found that in certain circumstances gcc makes faster binaries