3 ms·
> Picking up information from the environment - a sibling mentions /etc/env.d/gcc - seems fairly likely. Why would CLANG do this ?
by hulitu 3y ago
> Picking up information from the environment - a sibling mentions /etc/env.d/gcc - seems fairly likely.
Why would CLANG do this ?
- elteto 3y agoClang already replicates a bunch of flags, macros, and behaviors from gcc. The objective is to be a drop-in replacement, and make the developer experience much nicer when migrating. There are some rough corners, of course, but overall it’s actually very nice.
- JonChesterfield 3y agoIf clang didn't try to do the right thing based on the context it finds itself in, people would have to specify a lot more compiler flags to tell it what to do. Target triple, where libc is, where libstdc++ or libc++ is, what linker to use, what flags to pass the linker and so forth. This is much more annoying than `clang foo.c`.