-O2 to the linker? 18%? I just tried that and the filesize is still the same.I don't know really, lol. When I read that in the manpages, I immediately tested it, and it turned a 802kB app into a 658kB app, which made me go "wowww!". I then tried recompiling wxWidgets in that manner, but it did not seem to make a difference (although I am not sure whether or not I did it correctly. You know compiling wxWidgets is not precisely intuitive...). And since building wx takes forever, I did not bother any further. So far my experience with it.
-Wl,-O2
Am I missing something?
-O2 to the linker? 18%? I just tried that and the filesize is still the same.I don't know really, lol. When I read that in the manpages, I immediately tested it, and it turned a 802kB app into a 658kB app, which made me go "wowww!". I then tried recompiling wxWidgets in that manner, but it did not seem to make a difference (although I am not sure whether or not I did it correctly. You know compiling wxWidgets is not precisely intuitive...). And since building wx takes forever, I did not bother any further. So far my experience with it.
-Wl,-O2
Am I missing something?
Personally, I have currently no need to squeeze every bit out of my applications, so I prefer the linker running faster instead :)
But still, there is more in it than the eye meets.
And since building wx takes forever...
I have found this website (http://cmeerw.org/prog/freecpp/) which provides quick&dirty C++ language conformance tests for the Win32 platform. As C::B supports them, this website could be useful for deciding which compiler is best suitable for a specific project.
I think this comparison (although still in favour to gcc) is quite unfair. They compare a 3 year old version of gcc with the current release of DM and the current release of Microsoft Visual C++. However, it makes me smile that gcc still beats them.
Gotta love that of the C++ tests, MinGW ( not even native g++ ) only fails 2, one of which is "throwing destructor" which you shouldn't ever be using anyways.
And what a surprise, the old mingw fails C++0x extension tests *rolls eyes*
I have found this website (http://cmeerw.org/prog/freecpp/) which provides quick&dirty C++ language conformance tests for the Win32 platform. As C::B supports them, this website could be useful for deciding which compiler is best suitable for a specific project.
Gotta love that of the C++ tests, MinGW ( not even native g++ ) only fails 2, one of which is "throwing destructor" which you shouldn't ever be using anyways.
D:\Temp>(g++ throwing_destructor.cpp -o throwing_destructor.exe && throwing_destructor.exe && echo Success ) || echo Failure
Success
D:\Temp>(g++ friend_name_injection.cpp -o friend_name_injection.exe && friend_name_injection.exe && echo Success ) || echo Failure
Failure
D:\Temp>g++ --version
g++ (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Just for curiosity, I have tried to build the tests on C++ Language Features that failed with MinGW and I could build:
- throwing destructor
- friend name injection
- right angle brackets
The other tests still fail :(. Anyway, there are improvments :).
You realize they shouldn't just build but also return a non-zero exit code when you run them, right?
-O2 to the linker? 18%? I just tried that and the filesize is still the same.
-Wl,-O2
Am I missing something?
-Os optimizes sizeI can only repeat: read the manual.
and it doesn't need to be passed directly to the linker.
-O level
If level is a numeric values greater than zero ld optimizes the output. This might take significantly longer and therefore
probably should only be enabled for the final binary.
man gcc says:
-O1 Optimize.
-O2 Optimize even more...performs nearly all supported optimizations that do not involve a space-speed tradeoff.
-O3 Optimize yet more.
-O0 Do not optimize. This is the default.
-Os Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.
If someone tried any of the ones MSVC 2005 fails, I would want to slap them for making me go :? as I tried to read their code.
If someone tried any of the ones MSVC 2005 fails, I would want to slap them for making me go :? as I tried to read their code.
Which one for example?
Michael
int main(int argc, char *argv[])
{
int i = compl((2 bitor 4) xor 4) bitand 3;
bool b = not ((true or false) and true);
b and_eq true;
b or_eq false;
b xor_eq true;
b not_eq not b;
return 0;
}
Codeint main(int argc, char *argv[])
{
int i = compl((2 bitor 4) xor 4) bitand 3;
bool b = not ((true or false) and true);
b and_eq true;
b or_eq false;
b xor_eq true;
b not_eq not b;
return 0;
}
Yes, I have to admit it has made me confusing too :D. Anyway, I like C++, because it can always surprise me with something I did not even know possible and therefore stimulate my desire to continue studying and using it.
Anyway, e.g., compl (http://msdn2.microsoft.com/99wd44e4.aspx) is an alternative to the ~ operator. The others are explained here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/html/ISO646.asp).
Michael
No, no. compl is a way to get coworkers to :x and then kill you. :lol: