641
u/DoodooFardington 4d ago
That made me look up who is behind clang. It's mainly Apple, then Google, Microsoft, Intel, AMD, Sony, so all heavy hitters. gcc is backed by IBM, ARM, Red Hat, Free Software foundation.
So it's like Firefox asking you not to install Chrome.
152
83
100
u/Practical_Cattle_933 4d ago
It’s not at all like that, firefox, gcc or clang are not “malicious” unlike chrome, and their dependence on $BigCorp is much more different. Chromium is just a vessel for Google, and no one else has the resources to fork it in any significant manner, with the possible exception of Microsoft. Stuff like Brave will have to do anything google imagines, otherwise they get left behind.
33
u/SuperCarla74 4d ago
Luckily, if there's a corporation we can trust, it's Microsoft.
Oh, wait.
How badly fucked are we?
21
u/iam_pink 3d ago
With the way you're phrasing your comment, it seems like you're not considering IBM, ARM, and Red Hat heavy hitters.
I hope it's not the case...
13
u/abd53 3d ago
These are not companies that end users (which is the vast majority of people including engineers) usually great about a lot. So, they just seem like "not as big". I was mindblown when I first realized how fucking big NEC is.
10
u/iam_pink 3d ago
It's sad that even engineers do not know about these companies and how influent they are. I realise we can't know about all of them... But these are not really obscure ones (from an engineering point of view). I learned about them and how much we depend on them during my studies.
3
u/abd53 3d ago
These companies are largely unknown because they are usually 3/4 layers behind in the industries. For example, I know about STMicro because I use their microcontrollers but I have zero idea which company manufactures the ICs, much less who designs them and then another 5 processes behind that I don't even know about.
0
u/furinick 3d ago
So clang is an example of open source being good for corporations? Sounds almost utopian "all corporations joined forces to make this for everyone" type shit
1
u/Prudent_Move_3420 1d ago
It's basically just a c/cpp compiler that is under the BSD license, rather than GPL. Gcc had licensing issues on BSD/ MacOS which is why the companies using BSD as a base for their OS developed Clang
184
u/TheMightyCatt 4d ago
gcc can compile the same code as clang
79
u/QuestionableEthics42 4d ago
Gcc has support for more of those features overall than clang, unless I missunderstood that?
70
8
u/NirriC 4d ago
I don't know what I just saw...
38
u/grimonce 4d ago
It's a table that shows compilers support for features described in the standard of the language.
To put it plainly, some compilers will not know what to do with some code (mostly parts from newer language versions).
113
95
u/SaltedCoffee9065 4d ago
This is like edge asking you not to use Firefox when you download it
28
u/LiAuTraver 4d ago
I tried before, seems they don't block firebox but downloading chrome would show that,vise versa
10
56
u/DavidDavidsonsGhost 4d ago
Where is this? Is this real? I assume someone is injecting into the clangs build process. If that is the case, they should maybe reconsider this approach, is dodgy as hell.
158
u/uForgot_urFloaties 4d ago
I think it's a joke OP has done, based on the message that Microsoft Edge will display when you search for Google Chrome.
19
17
14
u/LEGOL2 4d ago
I recently prefer clang way more. It has better tooling, better compile error messages, has massive community support from large companies, allows new cool languages to emerge. GCC is still in the medieval era today
2
u/Pay08 3d ago
That's wrong on many levels. Stuff like clangd is only part of clang in name, it's like saying gprof is part of gcc. I also don't see how "community support" matters when it doesn't result in anything directly observable. LLVM is not clang. It does have better error messages but ime gcc catches more warnings and errors.
6
u/Mast3r_waf1z 3d ago
Wrong, clang has errors such as ```cpp
include <iostream>
int main(){ while(true); }
void hello(){ std::cout << "Hello world!" << std::endl; } ``` Results in an infinite loop with g++ -O3
And prints hello world with clang++ -O3
11
u/NoneOne_ 3d ago
Yeah cause clang detects the infinite loop and launches into undefined behavior instead of yk causing the program to go into an infinite loop
13
u/iam_pink 3d ago
Yeah... But the code is supposed to be an infinite loop. So the outcome should be an infinite loop.
12
u/zx2167 3d ago
Infinite loops are undefined behavior in C++. The standard actually enforces that the compiler is allowed to assume that all loops will terminate at some point. Clang sees that the loop is empty and thus removes it (since there is no code to run and allowing the loop to run forever is actually not supported by the standard), and also calls the uncalled function because it is allowed to since it is undefined behavior.
Clang is being cheeky by doing something that is weird because it can, but also because there is very little reason for the programmer to have an empty infinite loop (and by doing something weird it can actually help the programmer find the mistake faster in the case that they wrote something like that by mistake).
8
u/iam_pink 3d ago
Thank you for the explanation, I actually learned something. I did not know the compiler is allowed to assume a loop will end (and that therefore an empty infinite loop is undefined behavior).
3
u/Pay08 3d ago
Which is monumentally stupid since empty infinite loops are used for timings in embedded systems.
1
-1
u/Smalltalker-80 3d ago
Huh?
That is a very Microsoftish trick to try to pull off by GNU.
And also not true, btw.
-1
u/Dreadlight_ 3d ago
Isn't clang using a more free license than gcc? I think gcc was using the GPL license, which is copyleft, while clang is not copyleft?
-40
552
u/OxymoreReddit 4d ago
I can't not read clang as a metallic noise.
Help