Slashdot Mirror


Free Optimizing C++ Compiler from Microsoft

FortranDragon writes "Microsoft has made the command line toolkit for Visual C++ available for a free download. You can use the toolkit to build applications and redistribute them if you want (though you should read the EULA for the details, as always). This is a nice boon for those that have to deal with cross-platform compatibility, especially since Microsoft has tried to make Visual C++ more conformant to the ISO C++ standard. Go forth and compile your favorite OSS or FS programs today. ;-)"

85 of 953 comments (clear)

  1. platform SDK by halfdan+the+black · · Score: 5, Informative

    The platform SDK which includes the command line compiler, linker and debugger has allways been a free download (hasn't it). Also, the .net SDK which includes all the languages, libraries, and compilers has also allways been a free download, this is what sharp develop uses.

    1. Re:platform SDK by sweet+cunny+muffin · · Score: 3, Informative

      The command line C++ compiler was never included in the SDK. The C# compiler and so on were, however.

    2. Re:platform SDK by Anonymous Coward · · Score: 1, Informative

      The difference here is that this compiler is "optimizing".

      I know alot of windows game developers use the MS IDEs and compilers, so this _is_ useful.

    3. Re:platform SDK by Danster · · Score: 2, Informative

      The platform SDK which includes the command line compiler, linker and debugger has allways been a free download (hasn't it). Also, the .net SDK which includes all the languages, libraries, and compilers has also allways been a free download, this is what sharp develop uses.

      Not quite.

      The Platform SDK ships the 12.00.880 version of the VC++ compiler, which roughly corresponds to the 2002 version of Visual Studio .NET.

      This release is the 13.10.3077 version which corresponds to the current version of the environment -- Visual Studio .NET 2003.

      So no, not quite the same thing.

    4. Re:platform SDK by Anonymous Coward · · Score: 1, Informative

      > The platform SDK which includes the command line
      > compiler, linker and debugger has allways been a
      > free download (hasn't it).

      No.

      Under Windows 3.x, the SDK was a separate purchase from the compiler. Microsoft C/C++ 7 was $199 and included support for DOS and OS/2(Presentation Manager was not yet available.) The SDK was $500 and included the headers/debug libraries, miscellaneous tools like the stress tester and the message spy utility, two feet of rather poor documentation, and Qualitas' 386Max which had something to do with DPMI implementations.

      When the build environment finally integrated with Windows(C/C++ 7 used the DOS-based PWB) they started including the SDK with the compiler.

      I don't recall when MASM ceased being a $99 product and became available in the SDK.

    5. Re:platform SDK by hobuddy · · Score: 4, Informative

      The command line C++ compiler was never included in the SDK. The C# compiler and so on were, however.

      That's incorrect. The .NET SDK has always included the C++ compiler (installed by default to C:\Program Files\Microsoft Visual Studio .NET 200x\Vc7), but the compiler was the Standard Edition, without an optimizer. If you pass it an optimization switch, the Standard Edition issues a warning to the effect that "The Standard Edition of Microsoft Visual C++ does not include an optimizer.". Naturally, lack of an optimizer makes the Standard Edition almost useless for production code.

      This newly released command-line compiler includes a fully functional optimizer. It's the same C++ compiler that underlies VC++ .NET 2003 Professional.

      --
      Erlang.org: wow
  2. Re:Not needed by Anonymous Coward · · Score: 5, Informative

    There's a decent free IDE available called Dev-C++ for windows, it comes with mingw32 ofcourse.

  3. Re:Microsoft offers interoperatibility? by sploo22 · · Score: 2, Informative

    As usual, they won't let you view the license before you download it.

    --
    Karma: Segmentation fault (tried to dereference a null post)
  4. wow, good job microsoft! by timecop · · Score: 2, Informative

    This is absolutely awesome.

    While there were legal methods to obtain optimizing compilers before (you could order media-cost-only Windows 2003 DDK cdrom and with that you'd have vc++ 7.0 compilers), but with this kit there's no longer any problems.

    While VS.NET 7.1/2003 IDE is quite well developed, I'm sure projects such as eclipse or dev-c++ can benefit from this.

    Also notice the important thing about this kit is it includes optimizing compilers, free command-line tools which were available for a while from the Microsoft .NET framework SDK did not have optimization command-line options enabled.

    Before this, there were ways to obtain the optimizing version of vc++ compilers, by ordering a recent Windows 2003 DDK (it included vs.net 7.0 compilers, if I remember correctly). But now with this kit,

  5. Re:Not needed by lpontiac · · Score: 4, Informative
    • Microsoft's compiler produces better (smaller, faster) x86 code than GCC.
    • I get the impression that when you move above vanilla C code (eg C++, libraries distributed in binary form only), different compilers don't play so nicely. (Just like gcc 2.9x versus gcc 3.x). And most of the binary only stuff out there on Windows is compiled with Visual C++.
  6. Re:Weird Output by naden · · Score: 1, Informative

    Because you're a retard who doesn't know how to code C?

    Or how about because I pressed Submit accidentally instead of Preview .. do you think that could have something to do with it ??

    #include <stdio.h> .. it strips out the HTML tags if you set it as Plain Text.

    not that I have any idea why im responding to an AC .. heh its a quiet night.

    --
    Funtage Factor: Purple
  7. Re:in other words by Anonymous Coward · · Score: 1, Informative

    like gcc, for free

    No, not like GCC. MS's compiler is free in the sense that you do not have to pay anything for it. GCC is also available at no cost, but it is free in sense that it is an open product, developed using the principles of free speech.

  8. Re:My experience with VC++ by startup.cmd · · Score: 5, Informative
    Anyone know where to get a free visual debugger for Win32?

    MS provides the Debugging Tools for Windows as a free download. GUI and command line debuggers are included.

  9. No lib.exe by Asmodeus · · Score: 3, Informative

    Major omission - no lib.exe for building .a files

    Looks like this is just to encourage people to migrate to .NET as without lib.exe it is pretty useless for larger projects.

    Still, nice of them to release it

    Asmo

    1. Re:No lib.exe by swamp+boy · · Score: 2, Informative

      The original poster says "without lib.exe it is pretty useless for larger projects".

      My suggestion of building DLL's negates this complaint. Notice the original post didn't say "can't build static link library". A DLL on Windows is essentially the same as a ".so" on Unix. True, a DLL is not the same as a statically linked library, but in the original poster's comment aboutl "useless", one could easily build any number of DLL's for a large project. Indeed, this is how most commercial Win32 apps are built. Am I missing something?

    2. Re:No lib.exe by willll · · Score: 2, Informative

      In case you didn't notice, they didn't include a lot of stuff that's neccessary for building Windows apps: the Windows headers, the .lib files for linking with Windows stuff, a resource compiler, nmake, etc. You have to download some more stuff (for free as well) to get this stuff. That would be the Platform SDK.

    3. Re:No lib.exe by ajp · · Score: 5, Informative

      Try using the link /lib switch. It offers the exact same functionality as lib.exe.

    4. Re:No lib.exe by DotNetGuru · · Score: 2, Informative

      Just to put a fine point on how much this is the "exact same functionality". If you delete link.exe from your system then lib will fail to work. That's right, lib just calls link for you. It could be replaced by a batch file or a 1 line C program.

      The same goes for dumpbin and editbin. It's just a wrapper over link.

  10. Re:Weird Output by El_Ge_Ex · · Score: 1, Informative

    Sad as it is, VC++ probably would compile that. One of the reasons MS wasn't ANSI standard was that it would do things like let the programmer use printf() without using or .

    One of the weirdest though is the time I renamed a .c file to cpp and recompiled. Strange results....

    -B

  11. Re:MS seems to be doing a lot of this lately... by Anonymous Coward · · Score: 5, Informative

    just to clarify this Apple's dev tools ARE included, just NOT installed by DEFAULT.

    EVERY new machine SHOULD come with a separate developer's CD just as every boxed version of OSX should. The end user just has to apply some elbow grease in a) noticing this, and b) bothering to install it.

    Also in the unlikely event that the developer CD is not present or there is an upgrade it is ALWAYS available(even to free online developer members) as a download. Hell even the old classic dev toolset(name escapes me at the moment) has been available free since, what?, 1994/5 or so?

    The only commercial environments are things like Codewarrior(Metrowerks), Absoft FORTRAN, RealBASIC, etc. Codewarrior MIGHT be worth it if you are trying to make money as their compilers are proprietary and USUALLY optimize much better than gcc. (I don't think that anyone has done a recent set of benchmarks of Apple's latest improvements of gcc v. current Metrowerks compiler though...) ...and now that I'm thinking of it most OSes of recent years, free AND proprietary seem to come with some sort of gcc based plus IDE dev tools any more anyways, e.g. BeOS, *Linux, *BSD, OSX, MacOS 7.5-9.x etc. On top of this didn't M$ used to have pretty decent pricing(surprisingly) for VC++/dev studio only anyways? (It's been a while since I've bothered to check.)

  12. Re:MS seems to be doing a lot of this lately... by Artega+VH · · Score: 2, Informative

    For OSX dev tools come free on the software update cds.

    xcode, interface builder and more.

    also see The Fink Project

    --
    groklaw, wired and slashdot. The holy trinity of work based time wasting.
  13. Re:MS seems to be doing a lot of this lately... by SoSueMe · · Score: 5, Informative

    The very first thing it does is try to configure .net on your machine.

    Since my only Windows machine is 98, it couldn't complete the rest of the install.

    Yes, it is a sacrificial test machine. I just wanted to see the EULA.

  14. Re:can't believe I am doing this, but... by kryptkpr · · Score: 2, Informative

    I don't have VC++ installed, so I'm afraid I cannot cite very specific examples. Most of my troubles came from pointers (big surprise there), and if I recall correctly calloc() would randomly fail to initialize allocated memory. I also recall being angry that I cannot sizeof() a row vector in a 2D array, but sizeof() on a 1D array works fine.

    Most of my trouble likely came from being a n00b to the language, and coming from a Pascal background I don't quite like the way C does a few things things (like multi-dimensional arrays, and pass by reference).. but using VC++ made learning even harder, becuase stuff would just mysteriously fail to work post-compilation that worked fine on other compilers.

    (Disclamier: never touched C++ with even a 40 ft stick, and was using an older version of VC++, I think it was 4)

    --
    DJ kRYPT's Free MP3s!
  15. Free IDE for windows by boffy_b · · Score: 1, Informative

    Dev C++ http://dcplusplus.sourceforge.net/

    --
    Windows is only $500 if your time is worthless.
  16. Re:Microsoft offers interoperatibility? by Paul+Townend · · Score: 4, Informative

    The "learning edition" of MSVC++ prohibited you from commercially distributing binaries made with it (or perhaps even just distributing the binaries, I can't remember just now). It also displayed a pop-up window whenever you executed your code, reminding you of this.

    However, considering it cost virtually nothing to get the thing, I don't think this was particularly unfair.

  17. Loop variable? by BenjyD · · Score: 2, Informative

    I haven't used MS VC++ for a few years (fortunately), but does it still get the scope of loop variables wrong? So that this:

    {
    for(int i=0;i!=num;++i)
    {
    }
    for(int i=0;i!=num;++i)
    {
    }
    }

    would complain about i being declared twice? That used to really annoy me.

    1. Re:Loop variable? by Anonymous Coward · · Score: 1, Informative
      You don't even need that. If you always go by the most recent for-scoping rules, you can use a #define to make things work with VC++ 6. Something like:
      #define for if (0) {} else for
  18. Re:Code Size! by lkaos · · Score: 3, Informative

    Large code size != bad code generation.

    Considering a very common (and powerful) optimization of inlining. What you literally do is change function invocations to the code for that function.

    Another common (but more advanced optimization) involves making an optimized duplicate of a particular code path.

    What you're probably seeing is a difference between the included optimizations in GCC's -O2 verses MSVCP's -02. Try enabling individual optimizations and then comparing code size if that's what you're interested in. That's a more fair metric.

    --
    int func(int a);
    func((b += 3, b));
  19. Re:crack is free first time by mattgreen · · Score: 4, Informative

    I know knowledgable comments are looked down on at Slashdot, but the .NET SDK has been free from the start and included cl.exe, (the C++ compiler) but it was the non-optimizing compiler I think. What the .NET SDK didn't have was the full STL and a few other things that are now free.

    The end-result of this is everyone gets a free compiler upgrade if they haven't moved to VC7.1 already. It means on my OSS project I can say "VC7.1 minimum," and expect everyone can follow suit without a problem. However I realize this isn't as fun as tin-foil explanations, so I'll let you get back to that.

  20. .NET is the potential for platform independence... by aksansai · · Score: 3, Informative

    The Mono group (http://www.go-mono.com) has been working on achieving platform independence with .NET and C#. Programming in C#, in many respects, has the feel that C++ is just getting ancient. C# constructs and methods, although not entirely mature, have learned from the best object oriented languages that we have right now.

    C# code for Microsoft's compiler (of an ECMA standard programming language), should run as advertised on a Mono CLR environment - once it becomes mature. Look at the many cross-platform (Windows/Linux) classes available for both .NET and Mono.

    Since Mono is an open-source effort, Mono could be extended to MacOS X, FreeBSD, etc.

    True portability is one source code - many OSes and architectures.

    --
    Ayup
  21. Build dll's using cl.exe by swamp+boy · · Score: 3, Informative
    You can easily build dlls with just cl.exe. You must remember to export things correctly though.

    class __declspec( dllexport ) MyClass
    {
    ...
    };

    I use a macro that handles this for me, with conditional directives to be empty on other platforms. Not that hard - really.
    1. Re:Build dll's using cl.exe by swamp+boy · · Score: 1, Informative

      Dude,

      I think you have no clue of what you spew. It is not irrelevant. It accomplishes the exact same thing. You can take however many classes or functions you like and bundle them into a single DLL the same way that you would do with a single library. In case you haven't noticed, the DLL is an acronym for "Dynamic Linked Library". So how is this a different purpose? Your initial post talked about working on a large project. This is what most professional developers do on Windows on a large project.

    2. Re:Build dll's using cl.exe by AArmadillo · · Score: 2, Informative

      The same technique that is used to build DLLs is also used to build statically linked libraries, its just a matter of using the right compiler/linker switch. Claiming there is no method of generating static or dynamically linked libraries under Visual C++ is just showing ignorance.

  22. Re:How about some evidence? by man_of_mr_e · · Score: 4, Informative

    This is a few years old (as are most of the benchmarks i've seen) but you can try this http://www.willus.com/ccomp_benchmark.shtml?p11

    Note that this is comparing MSVC 6 (current version is 7.1, and it's improved a lot). In this test, Intel beats everyone, MSVC comes in second with MingW third, however, both the Intel and MS compilers have improved massively in the last couple years. I don't know about MingW. At least part of MingW's success is that they use MS's runtime library, which means that a great deal of the code being run was compiled by MSVC.

  23. Re:Microsoft offers interoperatibility? by nukey56 · · Score: 2, Informative

    However, considering it cost virtually nothing to get the thing, I don't think this was particularly unfair.

    Not to be unfair, but I've got a fairer solution. Just season with a genetic optomizer.

  24. Re:More standards compliant? by swamp+boy · · Score: 3, Informative

    I'm continually amazed at the number of folks that bash MS for not following standards and then ridicule them when they do try. I'm certainly not an MS evangelist (nor an apologist), but seriously, what do you expect them to do?

    There has been some level of support for the Standard C++ Library (STL) since the 4.2 days. Granted it was broken and has been through 6.0. This is because they used an implementation written by PJ Plauger who worked for Plum Hall at the time. Plauger had a falling out with Plum Hall over the rights to said code. This is the legal battle that has caused problems since the 4.2 days. You can easily download the half dozen or so header file patches for this though. FYI - Plauger now has his own company "Dinkumware".

    I have not used their latest compilers to know the current situation. Although there have always been standards compliance problems with MS compilers, at least they're getting better over time.

  25. Re:no! by firew0lfz · · Score: 4, Informative

    karma whoring, but anyway, here is the EULA:

    END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE

    MICROSOFT VISUAL C++ TOOLKIT 2003

    IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft") for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, "online" or electronic documentation, and Internet-based services ("Software"). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.

    MICROSOFT Software LICENSE
    1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.
    1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises except as otherwise specifically provided herein.
    2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES. In addition to the rights granted in Section 1, certain portions of the Software, as described in this Section 2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
    2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as "Samples" in REDIST.TXT or elsewhere in the Software ("Sample Code") for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section 3.1 below.
    2.2 Redistributable Code-General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Software listed in REDIST.TXT ("Redistributable Code"). For general redistribution requirements for Redistributable Code, see Section 3.1, below.

    3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Section 2, any redistribution by you is subject to your compliance with the following terms.
    3.1 If you are authorized and choose to redistribute Sample Code or Redistributable Code (collectively, the "Redistributables") as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code) to distribute the Redistributables only in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables ("Licensee Software"); (ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms; (iii) to distribute the Licensee Software containing the Redistributables pursuant to an end user license agreement (which may be "break-the-seal", "click-wrap" or signed), with terms no less protective than those contained in this EULA; (iv) not to use Microsoft's name, logo, or trademarks to market the Licensee Software; (v) to display your own valid copyright notice which shall be sufficient to protect Microsoft's copyright in the Software; (vi) not to remov

    --
    Try not to let life get in the way of living.
  26. Does not install on win98??? by Divlje+Jagode · · Score: 1, Informative
    Microsoft Visual C++ Toolkit Installer Information

    /!\ Microsoft Visual C++ Toolkit 2003 requires Windows 2000, Windows XP, or Windows 2003 Server.

    Well,
    I'll stick to BCC55 then...
  27. Re:Heeeeeeers EULA by Anonymous Coward · · Score: 1, Informative

    This is basicaly the same EULA as the regular VC++ package. It restricts what you can do with Microsoft's code, but not what do with your own code. Get over it!

    Check out section 3.1.i and 3.1.ii, which EXPLICITY DENY you from distributing your source-code.

    You can't distribute THEIR source code. Do whatever you want with your own code.

    6 is even better: "NO RENTAL/COMMERCIAL HOSTING.

    No rental or commercial hosting OF THE COMPILER itself. Do whatever you want with your own code.

  28. Re:MS seems to be doing a lot of this lately... by The+Infamous+Grimace · · Score: 2, Informative

    If developer tools are to be free as in lunch, then why not just make them available for download.

    They are. You have to register, though. Make up a dummy account if you don't want Apple to have your real info. You can find development kits with IDEs for use with 10.2 and 10.3. I use Xcode quite a bit, although I'm also learning to work with vi and make.

    (tig)
    --
    Ignorance and prejudice and fear
    Walk hand in hand
  29. Re:Port to Linux by SlightOverdose · · Score: 2, Informative

    Why not just develop for .NET? this way you can compile using either Microsofts compiler or either of the free open source compilers Portable.NET or Mono), and run it natively under either of the said runtimes.

    And yes, this works. I have a project I'm working on now that I wrote in VS.NET2003 and ran with no problems using Portable.NET

    I can compile with Portable.NET and it works under Windows. I can compile with Microsoft c# compiler and it runs under Linux. Just like Java, minus the insanely ugly and slow Swing widgets.

  30. Ok, here's one by CrystalFalcon · · Score: 4, Informative
    Functions in named classes inside template classes, that are not written inline.

    Example: You create a storage class (my example was a self-redistributing binary tree). The template class Storage<T> has a subclass Storage<T>::Element that holds three Element pointers (parent, left child, right child) and one const <T> pointer.

    Of course, the Element class has a constructor, a destructor, a copy constructor, and an assignment operator defined. (Copy constructor and assignment op may not be formally required, but my experience says it's a very good idea to define them in anything that holds pointers).

    As in:
    // === DECLARATION ===

    template <T>
    class SimpleBinaryTree
    {
    public:
    SimpleBinaryTree();
    ~SimpleBinaryTree();
    void Add (const& T);
    // etc

    protected:
    class Element
    {
    public:
    Element();
    Element (const Element& source);
    ~Element();
    const Element& operator= (const Element& source);
    private:
    void Destroy();
    const Element& CopyFrom (const Element& source);

    }
    }

    // === IMPLEMENTATION ===

    template <T>
    void
    SimpleBinaryTree<T>::Element::Destroy()
    {
    // Clean up, common code for destructor and copy ops
    }

    template <T>
    const Element&
    SimpleBinaryTree<T>::Element::CopyFro m (const Element& source)
    {
    // Copy from 'source' - common code for
    // copy ctor and assignment op
    }
    This code will produce an error. VC++ does not handle functions in named classes inside templates that are not declared inline.

    (I may have missed some syntactic detail - It's been a long time since I wrote C++; I write C# these days. But the above annoyed me to no end. It works fine with gcc, which on the other hand can't handle when the functions are implemented inline, which should also work) :-(

    Side note: I absolutely love Microsoft's dev tools. This particular example is the exception to me, not the rule.
    1. Re:Ok, here's one by Yokaze · · Score: 4, Informative
      Some minor modifications like
      s/template<T>/template <typename T>/
      and for the external declarations
      s/ Element/ typename SimpleBinaryTree<T>::Element/
      and VS .Net 2003 says:
      ------ Build started: Project: test, Configuration: Debug Win32 ------

      Compiling...
      stdafx.cpp
      Compiling...
      test.cpp
      Linking...

      Build log was saved at "file://z:\devel\test\Debug\BuildLog.htm"
      test - 0 error(s), 0 warning(s)
      You probably tested it with .Net 2000. That version also had problems with partial template specialisations.
      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
  31. Re:How about some evidence? by Anonymous+Brave+Guy · · Score: 4, Informative
    I suspected someone would say Microsoft's compiler produces better code. Now where's the evidence?

    There are at least two easy answers to that question:

    • Look at the disassembly for any reasonably complex algorithm, and spot all the platform-specific optimisations that VC++ (and indeed most other commercial compilers on Windows) perform that GCC (due to its portability requirements) does not.
    • Use Google, and look for people who've compared the real world performance of non-trivial apps built with each compiler. (You might do better with Google Groups than the Google web search engine on this one.)
    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  32. Re:MS seems to be doing a lot of this lately... by Anonymous Coward · · Score: 1, Informative

    .NET runs on Windows 98. You can get it here. The SDK is also available from that page.

  33. Pass by reference in C by Anonymous+Brave+Guy · · Score: 2, Informative
    There is no pass by reference in C.

    Of course there is. You get pass by reference semantics by passing or returning pointers. It's not as clean as C++'s passing a reference, but that's just syntax, not semantics.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  34. Re:More standards compliant? by SlashdotLemming · · Score: 3, Informative

    Speaking of standards compliance...

    there ISO
    their ISO

    it's not there fault.
    it's not their fault.

  35. Compatability does not seem so much of a problem by spitzak · · Score: 4, Informative

    I have quite successfully linked C++ libraries compiled with GCC, VC++, and the IntelCC compiler with no problems. It appears to be ok. Perhaps code that relies on internals of STL would fail, but at least pointers to STL objects actually port back and forth.

    I agree that VC++ produces faster code than GCC. Don't really know how much, because we don't use GCC on Windows anymore because of this, except to make dependencies for the makefiles. Can't be too much today, as our GCC-compiled Linux versions seem to run at the same speed as the IntelCC compiled Windows version.

    The IntelCC compiler produces code almost twice as fast as VC++6. I believe VC++7 is much better, however, but have not tested it.

  36. Try VC7 by jridley · · Score: 2, Informative

    VC7 is head and shoulders above VC6 for standards compliance, including templates. Our company is switching mainly just to get better templates compliance. We do not always upgrade; we skipped VC5, stayed on VC4.2 until VC6.
    I'm not a compliance expert (I'm more of a perl hack), but the people at the company that are into advanced C++ code like the new compiler very much.

  37. Re:Yes, but... by MrBlue+VT · · Score: 2, Informative

    You can use POSIX via Windows Services for Unix.

  38. Re:My experience with VC++ by Anonymous Coward · · Score: 1, Informative

    Through my employer, I took a C++ course taught by the secretary of the ISO C++ committee. Most of use were using Microsoft Visual C++. Three of use used g++ (GNU) 2.95.3. Our instructor used Microsoft Visual C++, and a Greenhills compiler. For interest, we tried various programs to see which compilers required that we follow the standards and which would let us get away with non-standard code. The Microsoft compiler would let use get away with the most and sometime actually required that we don't follow the standard.

  39. Re:MS seems to be doing a lot of this lately... by mattgreen · · Score: 3, Informative

    The system requirements list Win2000 on up and you complain that it won't install on Win98. Classic.

  40. From the posted EULA by Spaceman40 · · Score: 2, Informative

    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.

    As in, for demonstration only. If you're going to distribute binaries, don't compile them with this tool.

    --
    I [may] disapprove of what you say, but I will defend to the death your right to say it.
    1. Re:From the posted EULA by shiftless · · Score: 5, Informative

      1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.

      As in, for demonstration only. If you're going to distribute binaries, don't compile them with this tool.


      Nope. That clause governs copying of the Software- in other words, the compiler. It says nothing about distribution of works you create using the Software.

    2. Re:From the posted EULA by Anonymous Coward · · Score: 1, Informative

      The copy that you make when download the installer from MS website can then only be used for testing/demonstrating your application and for eveluating the compiler.

      The post you replied to listed internal use as the first use listed, and is the primary use as well in almost any situation. Its pretty obvious if you read the clause you can tell that MS is really only concerned with businesses using the compiler to make their programs without paying the necessary fees. But for personal use, there don't appear to be any restrictions on using the compiler itself (of course distribution restrictions for the compiler software are probably not the same).

  41. Re:MS seems to be doing a lot of this lately... by ajp · · Score: 3, Informative

    As it says on the downloads page: "Supported Operating Systems: Windows 2000, Windows Server 2003, Windows XP". The page also points out that it does try to install .NET (not that anyone reads the page...)

  42. Re:Microsoft offers interoperatibility? by arkanes · · Score: 2, Informative
    I just read the EULA. I'll post it here, after my comment.

    There's suprisingly little in it, the vast majority of it is standard boilerplate. Only the first clause relates to what you can do with it, and it seems to limit you to personal use only (ie, no selling the binaries you create), but it's not explicit. The rest of it deals with standard redistributables (the C/C++ runtimes/STL) and standard waivers of liability, etc.

    Presumably because it's distributed/sold in Quebec, theres a bunch of French at the end which, in the interests of space, I have snipped.

    END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
    MICROSOFT VISUAL C++ TOOLKIT 2003
    IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft") for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, "online" or electronic documentation, and Internet-based services ("Software"). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.

    MICROSOFT Software LICENSE
    1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.
    1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises except as otherwise specifically provided herein.

    2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES. In addition to the rights granted in Section 1, certain portions of the Software, as described in this Sectionÿ2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
    2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as "Samples" in REDIST.TXT or elsewhere in the Software ("Sample Code") for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section 3.1 below.
    2.2 Redistributable Code-General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Software listed in REDIST.TXT ("Redistributable Code"). For general redistribution requirements for Redistributable Code, see Section 3.1, below.

    3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Sectionÿ2, any redistribution by you is subject to your compliance with the following terms.
    3.1 If you are authorized and choose to redistribute Sample Code or Redistributable Code (collectively, the "Redistributables") as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code) to distribute the Redistributables only in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables ("Licensee Software"); (ii)ÿthat the Redi

  43. C# and VB.Net free also, SQL by JamesR2 · · Score: 2, Informative

    This is not new. The .Net framework free d/l includes V# and VB command line compilers. In fact, I think that Visual Studio uses those under the covers. If you need SQL, you can use free MSDE ... yes restrictions, but 2GB db is enough for some work.

  44. Re:Weird Output by scotch · · Score: 2, Informative

    Not for standard compliant C++, bucko.

    --
    XML causes global warming.
  45. Re:How about some evidence? by dial0g · · Score: 2, Informative

    Latest issue (May) of DDJ has an article on compiler performance.

    For C code, VC++ 7.1 ranked 2nd (tied with Intel and Open Watcom) whereas GCC ranked 8th.

    For C++ code GCC and VC++ 7.1 were tied for 2nd.

    I'll leave it to you to buy the magazine if you want the details (they tested 9 x86/Win32 compilers all together).

  46. Re:Visual Studio 6 integration? by Anonymous Coward · · Score: 2, Informative

    It should be possible -- I've integrated the C compiler from the DDK with VS6, and that's basically the same compiler as what MS is giving away now. If you're happy with the VS6 IDE, this is a good way to keep the IDE you like, while getting the benefits of the latest compiler.

    Select the Tools | Options menu and go to the Directories tab of the Options dialog. Add the directories for new C compiler to the top of the lists for Executable files, Include files, and Library files. I'd also recommend downloading the Platform SDK and using the Windows headers/libraires from there rather than the ones that came with VC6 (which date back to the NT 4.0 era).

  47. Re:How about some evidence? by Too+Much+Noise · · Score: 4, Informative
    heh - benchmarking, gotta love it. Here's a clue about (more recent) compilers - note that the bench you linked to has what would be a 5-gen-old gcc (2.7.x). even 2.9* used to spank MS' cl 13.x (that's the pre-release versions of 7.0 that were also freely downloadable - in fact, MS used to give away compiler toolchains for a long time as part of the SDK, old news, huh?).

    1. recent icc (7.x, 8) spank about everyone on vector fp due to various reasons (like Intel not releasing a full spec of the SSE2 unit - check out the gcc mailing lists about SSE2, you'll see they didn't have info on timings and so on, hence gcc does only some integer optimization and mostly scalar fp).

    2. icc does some (nice when not useless) automatic parallelization of code (the idea being to use hyperthreading better).

    3. gcc 2.9x -> 3.1+ was a big improvement as well (moreso for 3.2+, check the docs for the new way they do the machine description for scheduling). Just check your own link.

    4. -ffast-math on gcc only has it do what both Intel and MS are already doing - using the bloody fp unit instead of software emulation!!! (easy proof - do an asm dump of the generated .o file).

    5. another big thing that's done by default by icc and cl is the gcc flag -fomit-frame-pointer (which on x86 is quite important due to register starvation). Again, gcc has that missing.


    Actually, looking at the compiler flags makes me wonder whether there's any point in taking those bench's seriously - the guy didn't even bother to use anything more than -mcpu=i686 (aka 'generate for pentium pro) for gcc, and the other compilers' switches are still close to minimal (even if they mean quite more than the gcc one). Makes one wonder about how competent the guy doing the benchmark was.
  48. Intel has a smilar deal by Animats · · Score: 4, Informative

    Intel's C++ compiler is also free for non-commercial use. It even runs under Linux.

    1. Re:Intel has a smilar deal by Johnno74 · · Score: 3, Informative

      Yes, but MS are now allowing you to download this compiler for free, and use it for COMMERCIAL use as well.

      Quite a big difference, IMO.

    2. Re:Intel has a smilar deal by the_greywolf · · Score: 4, Informative

      last i checked, Intel's non-commercial license is explicitly linux-only. the only download for the Windows compilers are 30-day evaluations only.

      that is, after 30 days, every executable in the Intel directory becomes useless after 30 days.

      --
      grey wolf
      LET FORTRAN DIE!
  49. Re:MS seems to be doing a lot of this lately... by c4Ff3In3+4ddiC+ · · Score: 4, Informative
    What development tools? What language? What IDE? There are so many to choose from. If the CD doesn't have the right one, then it doesn't do any good anyway.

    Just wanted to note. If you install the dev tools on MacOS X, you get perl, python, ruby, c, c++, objective-c, java, php, bash, and probably more right from the start. You even get emacs and vim!

    You also get a nice IDE called Xcode. I don't do much programming so I can't say how nice it really is, but it does the usual project management, debugging, etc that you would expect.
    --
    *twitch*
  50. Re:Weird Output by tesmako · · Score: 2, Informative

    Actually implicit int return type is no longer legal in C99 so a good compiler should at least warn about it by now imho.

  51. Get your free Microsoft Debugger right here by kylef · · Score: 4, Informative
    Anyone know where to get a free visual debugger for Win32?

    Ask and ye shall receive:
    Microsoft Debugging Tools for Windows

    That toolkit is part of the (also free) Platform SDK, but you can install it separately. It includes NTSD (command-line debugger) and WinDBG (GUI debugger), and KD (the kernel debugger). NTSD and WinDBG sit on top of the same user-mode debugging engine, "dbgeng.dll". They both include really fantastic on-line help which can teach you a lot about debugging in Windows. That said, they are not for the faint-of-heart (the Visual Studio debugger is much more user-friendly). KD.exe uses the kernel-mode debugger built into every NT kernel by default. Of course, you need a second machine to use KD and a serial cable; when broken into the NT kernel debugger, the debuggee is not in control.

    (Incidentally, is there a kernel-mode debugger available for Linux? Last time I checked, Linus opposed the concept very strongly, and Linux did not have one available. He called it a "crutch." Sorry, Linus. Kernel-mode device driver writers *like* their debuggers. I have to say that this could be one of several factors impeding device driver development on Linux.)

  52. Not an IDE by jsoderba · · Score: 2, Informative

    There is no IDE, just command-line tools. The "build manager" referred to by the grandparent is msbuild.exe, a command-line tool that speaks a (N)Ant-like XML syntax.

    As I understand it, VS.NET 2003 will use the same syntax, so you should be able to build a VS.NET project using the free SDK.

  53. Re:Weird Output by The+Snowman · · Score: 3, Informative

    With MS's latest C++ compiler (and with newer Os's), you need "\r\n" to make a new line. This drove me nuts when I first started doing it. Now, it's not so bad.

    That is weird, I do not have this problem. The I/O layer should translate newlines for you. All I ever use in Windows programs (console and GUI) is '\n' and it ouputs "\r\n" as well as reversing it on input. This is in both MinGW and Visual C++

    --
    24 beers in a case, 24 hours in a day. Coincidence? I think not!
  54. Re:How about some evidence? by fatphil · · Score: 2, Informative

    Erm:

    "-ffast-math on gcc only has it do what both Intel and MS are already doing - using the bloody fp unit instead of software emulation!!! (easy proof - do an asm dump of the generated .o file)."

    bash-2.05b$ more foo.c
    double foo(double a, double b, double c, double d)
    {
    return (a+b)*(b+c)*(c+d)*(d+a);
    }

    bash-2.05b$ gcc -S -O3 -fno-fast-math foo.c
    bash-2.05b$ more foo.s
    .file "foo.c"
    .text
    .p2align 4,,15
    .globl foo
    .type foo, @function
    foo:
    pushl %ebp
    movl %esp, %ebp
    fldl 8(%ebp)
    fldl 16(%ebp)
    fldl 24(%ebp)
    fld %st(2)
    fadd %st(2), %st
    fldl 32(%ebp)
    fxch %st(3)
    fadd %st(2), %st
    fxch %st(2)
    popl %ebp
    fadd %st(3), %st
    fxch %st(1)
    fmulp %st, %st(2)
    fxch %st(2)
    faddp %st, %st(3)
    fmulp %st, %st(1)
    fmulp %st, %st(1)
    ret
    .size foo, .-foo
    .section .note.GNU-stack,"",@progbits
    .ident "GCC: (GNU) 3.3.3 (Debian 20040401)"

    If that's not using the FPU unit, then I'm a Dutchman.

    FP. (Not a Dutchman)

    --
    Also FatPhil on SoylentNews, id 863
  55. Re:Edit with VC6, use Scons to build.. by baxissimo · · Score: 4, Informative
    There could be switches whose meanings have changed slightly, but I just ran the two versions of "cl.exe /?" and compared the output of the two. Here's the list of differences:

    OPTIONS THAT WERE IN VC6 BUT AREN'T IN VC7 cl.exe:
    /GD optimize for Windows DLL
    /noBool disable "bool" keyword
    NEW VC7 cl.exe OPTIONS:
    /AI<dir> add to assembly search path
    /FU<file> forced using assembly/module
    /Fx merge injected code to file
    /G7 optimize for Pentium 4 or Athlon
    /GH enable _pexit function call
    /GL[-] enable link-time code generation
    /GS enable security checks
    /GT generate fiber-safe TLS accesses
    /QIfist[-] use FIST instead of ftol()
    /RTC1 Enable fast checks (/RTCsu)
    /RTCc Convert to smaller type checks
    /RTCs Stack Frame runtime checking
    /RTCu Uninitialized local usage checks
    /WL enable one line diagnostics
    /Wall enable all warnings
    /Wp64 enable 64 bit porting warnings
    /Y- disable all PCH options
    /Yl[sym] inject .PCH ref for debug lib
    /Zc:arg1[,arg2] C++ language conformance, where arguments can be: forScope - enforce Standard C++ for scoping rules wchar_t - wchar_t is the native type, not a typedef
    /arch:<SSE|SSE2> minimum CPU architecture requirements, one of: SSE - enable use of instructions available with SSE enabled CPUs SSE2 - enable use of instructions available with SSE2 enabled CPUs
    /clr[:noAssembly] compile for the common language runtime noAssembly - do not produce an assembly
    /showIncludes show include file names
    /w<l><n> set warning level 1-4 for n
    /wd<n> disable warning n
    /we<n> treat warning n as an error
    /wo<n> issue warning n once
    @<file> options response file
    So as you see most of the differences are new switches for the VC.7 version of cl.exe. Those shouldn't cause any trouble, as VC6 just won't use them by default. The two options removed I don't think are very interesting to most poeple. Besides, the VC.7 cl.exe is happy to ignore them:
    C:\Program Files\MSVC++2003>cl /nobool
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3052 for 80x86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

    cl : Command line warning D4002 : ignoring unknown option '/nobool'
    cl : Command line error D2003 : missing source filename
    So as another poster has said, it looks like it should just work if you put the new directories first in the MSVC6 bin/lib/include paths.

    Cool! All the updates I care about for VC 6 without having to switch to a new IDE!
  56. Re:Using new compiler with Visual Studio 6? by omicronish · · Score: 4, Informative

    I wonder if it is possible to use the newer commandline compiler from within Visual Studio 6. From what I hear, the .NET IDE isn't so great for C/C++ work. And come on, a project file is now called a "solution" file?? That's just dumb.

    I'm currently writing C++ code using Visual Studio.NET, and I haven't noticed any problems compared to Visual C++ 6. Some of the keyboard shortcut defaults are different, but you can revert to the VC++ 6 layout easily.

    I think the main reason it might not seem as good for C++ work is that VS.NET adds considerably more features geared towards .NET development, while C++ appears to be neglected somewhat. Remember that VS.NET's IDE supports all their .NET languages, and C++.

    For clarification, a solution can contain multiple projects. The old term they used was workspace. Yeah, I thought it was weird at first, but it's just terminology, plus a workspace sort of implies open windows and developer-specific settings to me. A single solution can be used by multiple developers (CVS works nicely).

  57. Re:Optimizing beyond Win32... by SnowZero · · Score: 2, Informative

    And if you'd ever used their Alpha compiler you'd know how far behind the x86 compiler it was. Even internal MS developers had a lot of problems with it. The Itanium could be better supported perhaps, as they probably got some help from Intel and generally have their act together better now.

  58. Re:Yes please! Don't increase the cost for the res by Kalak · · Score: 2, Informative

    Heck, the CD I have is out of date and I have to go to the developer's tools page http://developer.apple.com/ to download the newest version anyway. Why bother giving me a CD? Just a pamphlet (nice and bio-degradeable and recycled paper if you could please, since I'm throwing it away anyway) giving me the URL?

    Or a link from the OS? OH wait! There is one! Apple Menu, Mac OS X Software, Clink on "Developer" in the web site's menu.

    Why were we talking about distributing CDs again? Developers will most likely be downloading the latest version of the tools anyway. (Have you not updated gcc? Visual C++?) Make the tools available, and they will code.

    --
    I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
  59. Re:I suppose Electric Fence and Valgrind don't cou by wbtotb · · Score: 2, Informative

    IIRC, Electric Fence detects heap buffer overflows (presumably using guard pages). MS has AppVerifier, which allows you to turn that on for arbitrary programs at runtime. It also has a bunch of other settings you can tweak, like causing the OS to report a different version. It's a great tool for testing obscure boundary cases.

    The security checks metioned here are at code-gen time. They do things like insert cookies on the stack to detect stack buffer overflows.

  60. Re:Using new compiler with Visual Studio 6? by baxissimo · · Score: 2, Informative

    Ok, I gave it a try, the new free compiler with VC6 IDE. It seems to compile and run ok. But debugging doesn't work.

    The new link.exe complained that it doesn't know the /pdbtype flag. It still ignored it and linked ok, but when I went to debug, VC6 said the exe didn't have any debugging symbols. I've tried changing the debugging options in VC6 a few different ways (C7 compatible, no program database etc), but nothing I've tried makes the debugger happy.

    So it looks like this may not be something that will work as well as one might hope, unless anyone has any other ideas.

  61. Re:How about some evidence? by be-fan · · Score: 3, Informative

    Loop vectorization does not have to do with hyperthreading. Loop vectorization takes code like this:

    for(...iterate over buffer...)
    for(...iterate over vector...)
    do_scaler_op()

    And turn it into code like this:

    for(...iterate over buffer...)
    do_vector_op(...on vector...)

    This has nothing to do with hyperthreading. Hyperthreading deals with parallelism between threads, not parallelism within threads. Intel has a seperate facility for the compiler to generate seperate program threads (OpenMP), but the auto-vectorizer does not. The auto-vectorizer works at a much lower level, replacing several scaler ops with a smaller number of vector ops. GCC does not have the analysis technology necessary to do that.

    --
    A deep unwavering belief is a sure sign you're missing something...
  62. Um, huh? by devphil · · Score: 2, Informative
    With this compiler and the USFW annoucement, you can now take the *nix stuff and port it pretty easily and for free to Windows. No more need to assemble tools, install Cygwin or the like.

    So, no more need to install precompiled and tested binaries, you can now port the exact same code (where did you plan on getting it?) by hand yourself and find a whole new set of bugs. Yeah, brilliant. Oh, you say you weren't going to use the GNU code? Great, yet another weird variant of coreutils.

    Installing Cygwin is hardly a chore. I click setup.exe, tell it what to get, and walk away.

    If you don't like the restrictions that come with the POSIX-layer DLL, then install MinGW instead. Same tools, same source code, same GNU extensions that we're already used to, no cygwin1.dll.

    There used to be a barrier to getting *nix stuff to Windows.

    You're either smoking crack or you haven't actually tried installing Cygwin in the last three years. I regularly run xterms under XP's own window manager, integrated clipboards, latest builds of just about everything. If you claim *nix stuff has been "missing," then you clearly haven't tried looking.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  63. Re:Weird Output by treke · · Score: 2, Informative

    The header file part was eaten by /. since it looks like an html tag. You need to use the html entities for the greater and less than signs.

  64. The Full EULA per request (sans francais) by the_greywolf · · Score: 2, Informative

    END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE

    MICROSOFT VISUAL C++ TOOLKIT 2003

    IMPORTANT-READ CAREFULLY: This End-User License Agreement (&#147;EULA&#148;) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation (&#147;Microsoft&#148;) for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, &#147;online&#148; or electronic documentation, and Internet-based services (&#147;Software&#148;). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.

    MICROSOFT Software LICENSE
    1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
    1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.
    1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises except as otherwise specifically provided herein.
    2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES. In addition to the rights granted in Section 1, certain portions of the Software, as described in this Section 2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
    2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as &#147;Samples&#148; in REDIST.TXT or elsewhere in the Software (&#147;Sample Code&#148;) for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section 3.1 below.
    2.2 Redistributable Code-General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Software listed in REDIST.TXT (&#147;Redistributable Code&#148;). For general redistribution requirements for Redistributable Code, see Section 3.1, below.

    3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Section 2, any redistribution by you is subject to your compliance with the following terms.
    3.1 If you are authorized and choose to redistribute Sample Code or Redistributable Code (collectively, the &#147;Redistributables&#148;) as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code) to distribute the Redistributables only in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables (&#147;Licensee Software&#148;); (ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms; (iii) to distribute the Licensee Software containing the Redistributables pursuant to an end user license agreement (which may be &#147;break-the-seal&#148;, &#147;click-wrap&#148; or signed), with terms no less protective than those contained in this EULA; (iv) not to use Microsoft&#146;s name, logo, or trademarks to market the Licensee S

    --
    grey wolf
    LET FORTRAN DIE!
  65. Re:Sounds like a dig at GPL really deep by Anonymous Coward · · Score: 0, Informative

    You guys are paranoid illiterates. It says you can't give out their code to their redistributables because you don't have the right to do that. I.e. the source code to sprintf if you linked in libcmt.lib or something of that nature.

    Redistributables = Microsoft's binaries normally allowed to be given to end-users by YOU directly as part of your application. (C++ runtime DLL's, C runtime DLLs, MFC DLL's etc)

    Did you read section 2.2 where it legally defined redistributable?

  66. Re:Does that mean: NO GPL-style Licenses??? by Anthony+Bailey · · Score: 2, Informative

    Assuming that "Redistributables" is defined to be the downloadable software development kit (as it is in licenses for similar MicroSoft SDKs) then I think you should not be worried.

    My reading would be that the GPL is indeed "Excluded" according to the clause above. (Again, the term/clause is not new in MS SDK licenses.) But this just means you can't e.g. redistribute the SDK itself under the GPL.

    The object files produced by a compiler are not considered to be derivative works of the compiler. So, you can distribute binaries compiled with this SDK under any license you desire. The analogy is that you can safely use Word to edit a document without Microsoft having a copyright claim on the resulting document.

  67. Re:Weird Output by Anonymous Coward · · Score: 4, Informative

    I'm fairly sure this behavior is required by the C/C++ standard. The key is to open streams in ASCII mode, rather than binary mode. Because C/C++ are designed to be portable, the standard I/O library is required to convert the line endings (but not in binary mode). Unix's binary mode is equal to its ASCII mode (since it uses \n natively).

    If the standard I/O library didn't understand line endings, then functions like fgets() could never work, and working with strings (where you expect to be able to match against \n) would be much harder.

    Networking is different, since it uses raw I/O, and doesn't pass through stdio's translation layer. Also, you usually want the binary data on the network. :) The Internet mainly uses \r\n as the line ending (although this made sense in the past, why they continue to stick with it in new protocols is beyond me, besides maybe the ability to easily telnet in and type in raw protocol commands by hand).

  68. Re:Weird Output by CabanaBoy · · Score: 4, Informative
    When you fopen() a file in binary ("rb", etc.) mode, you do have to take that into account. However, when you open in text mode ("r", "w", etc.) the stdlib does linefeed conversion for you.

    Here's an excruciatingly detailed explaination.

    Note that fseek() with SEEK_CUR will almost always fail in text mode, since the number of bytes read may vary from the current offset in the file due to the conversion. Recording the current offset with ftell() followed by an fseek() with SEEK_SET will clear that right up.

    Crazy but true. This has corrupted my data more than once. Here's an excruciatingly detailed explaination.