The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
newspaperman shortly ED
have taken complete control?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
To be fair it's not that much of an exaggeration to say that half of Microsoft's developer products have start with the word 'Visual'. If they'd developed Skype internally they'd probably have called it Visual Phone Calls.
cl.exe is a command line control tool. It is not the compiler.
c:\program files (x86)\microsoft visual studio 14.0\vc\bin>cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Of course the thing that controls the other thing will dump output from the other thing when you run it. I refer you again to the documentation I linked to, which clearly states that the cl.exe is a utility that controls MSVC.
Even if it's currently embedded in cl.exe the concept is distinct, meaning microsoft may expose the *MSVC* compiler as a service at some point (if they haven't already, i haven't kept up with their latest nonsense)
cl.exe is a tool that controls the Microsoft C++ (MSVC) C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio for Windows.
Read it carefully, and I think you'll understand why I call the compiler Microsoft Visual C++ and not "cl.exe"
This can be investigated with something like Project Explorer, by compiling some crazy "template template template parameters" stuff, which may give insane compilation time. Just reading the documentation, I can only guess that cl.exe is compiler, which runs the linker if necessary:
CL automatically invokes the linker after compiling unless the /c option is used.
From our point of view, this is not important, unless we want to develop some new makefile system. Not in my schedule for this week, anyway...
Fair enough, but based on the documentation produced by microsoft, and all of its related materials they do indeed call their compiler MSVC.
Therefore, I don't think it's exactly accurate to correct someone for referring to it as Microsoft Visual C++.
MSVC isn't an IDE. Visual Studio is an IDE, so there isn't really cross-confusion here save for the word "Visual" which is a misnomer when it comes to MSVC, but has *always been the same misnomer* ever since they introduced it, regardless of IDE. It's just what they call it.
Now, we may have different ideas about what it's "really" called. I tend to lean toward what the people that created it call it in their actual documentation and other materials.
You may call it what the command line executable is named.
I honestly don't care. I just don't think what I called it bears correcting, since it's accurate. It ultimately comes down to which name you think is more important (the cli name, or MS's given name), and I think reasonable people can disagree about that while both being correct in what they call it.
Now, if you take issue with that, so be it. I'm willing to die on that hill.
sure, but the people who made the compiler call it GCC
The people that made MSVC call it MSVC
regardless of what the command lines are or how they are structured. The only reason this tangent happened is because someone argued that because cl.exe is called cl.exe that has to do with what the compiler is named. I'd argue it doesn't.
While the MSVC compiler has improved significantly in recent years it still lags:
Note all the asterisks next to the C++20 library and language features.
The bottom line is those are partial or otherwise "supported with qualifications" which at the end of the day means your standard C++20 code might not compile for MSVC without conditional compiles.
Like I said, it has gotten better, but so did internet explorer before it was replaced.
I prefer to be able to use -std=C++20 and be confident that my standard code will compile, or if it won't, then it's *my fault* - metaprogramming is difficult enough when you know what you're using is fully supported. If it's not, tracking down the error can be a nightmare - I speak from unfortunate experience.
Additionally, the fact that MSVC consistently lags behind in standards support by years (i'm not saying lags behind other compilers, I'm saying lags behind the standard itself) means if I want my code to compile across compilers I have to dumb it down for the lowest common denominator.
And between the major compilers, that lowest common denominator comes up as MSVC. I guess some compiler had to fill that role, but they were going to be my target whoever they were, because they're going to be the reason that I can't have nice things.
Most of those asterisks seem to just show a different kind of version number.
20 years ago, MSVC lagged seriously behind the standard (I'm talkin' to you MSVC 6). Today, conformance is excellent, though for a given feature it may take longer to get into MSVC than the open-source compiler in which the feature was prototyped (duh). I'm comparing compilers for a book on optimization, and so far I haven't encountered a situation in which the three compilers didn't all support a feature, though I accept that they exist.
There are in fact differences in the way the compilers interpret the standard, but this has always been more a bug in the standard than in any of the compilers, or a situation in which one compiler accepts a more generous (nonconforming) syntax than another.
I'm guilty of glossing over most of that link. My fault. Serves me right for digging it up while in the middle of other things..
I admit a lot of my distaste for MSVC is historical. Pre 2017 it wasn't great, but since then I haven't used it as much as I used to because I do cross compiling mostly these days for MCUs and such.
That it didn't support SFINAE was just unacceptable, IMO.
At the end of the day, I don't trust their compiler products, and frankly, they earned that. It will take some time - a consistent showing of compliance over several standards versions for me to want to rely on them again.
It's possible to do portable executables (assuming I've picked the context right) with GCC , but clunky (haven't tried to do it with clang). You have to use windres to build a .res file, then you can link that as a source file like any other .c or .cpp file. Looking at an old makefile I think the "-mconsole" and "-mwindows" flags on the GCC command are important, but it's been long enough since I touched this that I can't really remember exactly how it works.