testing to see it toolkit compiler works with visual C++.net standard

Started by
7 comments, last by 3dmodelerguy 19 years, 2 months ago
I finally found a place that hade Visual C++.net standard and i download the 2003 toolkit and copied the 5 file from the bin to the visualC++.net bin folder. i have a simple console project up, my question is it there are type of code i can do the The standard compiler would give me a error or warning and the optomized compiler would not just to test to see if the optomized compiler is truly working?
Advertisement
I believe that if you specify optimization options, the non-optimizing compiler will warn you that they aren't supported. Other than that, you can compare the ASM outputs (there's an option somewhere to produce an ASM listing), or, assuming the non-optimizing compiler doesn't support NRVO (which is an optimization), check if

#include <iostream>struct Foo{   Foo()                      { std::cout << "Constructor" << std::endl; }   Foo(const Foo&)            { std::cout << "Copy constructor" << std::endl; }   Foo& operator=(const Foo&) { std::cout << "Copy assignment" << std::endl; return *this; }  ~Foo()                      { std::cout << "Destructor"  << std::endl; }};Foo bar() { Foo f; return f; }int main(){   Foo f = bar();}


does optimize some of the copying away (GCC only prints out "Constructor" "Destructor").
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
well that code work fine no warnings so i guess it works, right?
Quote:Original post by 3dmodelerguy
well that code work fine no warnings so i guess it works, right?


Probably, though you'd have to try it explicitely with the non-optimizing compiler to make sure: it might still have been built in. NRVO is one of the few optimizations which is actually allowed to change the program's behavior (eliminates calls to copy constructors, even though they might have side-effects).
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
i did it with both files but soth work fine. i really want to know it i installed the updated compiler correctly.
Go to the prohject settings and add some optimisation compiler switches in the Release configuration, e.g. /Ox.
The standard compiler will warn about disabled features if you compile while the professional toolkit won't.
Quote:Original post by darookie
The standard compiler will warn about disabled features if you compile while the professional toolkit won't.


Thanks for the confirmation.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
were do i add those switches?
nvm found it, in the commandline on C++ and linking folder

This topic is closed to new replies.

Advertisement