News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Quick&dirty C++ language conformance tests

Started by Michael, December 16, 2005, 02:45:09 PM

Previous topic - Next topic

Michael

Hmmm, the last two of the list return 1, but the first (throwing destructor) returns 0. Visual Studio C++ .NET 2003 and gcc version 3.4.4 (mingw special) gives the same results and behaves (for what I could see) in the same way.

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

grv575

Quote from: Ceniza on December 17, 2005, 04:45:59 PM
-O2 to the linker? 18%? I just tried that and the filesize is still the same.

-Wl,-O2

Am I missing something?

-Os optimizes size
and it doesn't need to be passed directly to the linker.
Still optimizing for speed is more important (-O2, -O3)

thomas

Quote from: grv575 on December 18, 2005, 04:32:42 AM-Os optimizes size
and it doesn't need to be passed directly to the linker.
I can only repeat: read the manual.

Quote-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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

grv575


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.


thomas

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

280Z28

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.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

Michael

Quote from: 280Z28 on January 22, 2006, 04:28:07 PM
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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

280Z28

Quote from: Michael on January 22, 2006, 05:33:30 PM
Quote from: 280Z28 on January 22, 2006, 04:28:07 PM
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;
}
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

Michael

Quote from: 280Z28 on January 22, 2006, 05:35:27 PM
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;
}


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 is an alternative to the ~ operator. The others are explained here.

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

280Z28

Quote from: Michael on January 22, 2006, 05:49:33 PM
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 is an alternative to the ~ operator. The others are explained here.

Michael


No, no. compl is a way to get coworkers to  :x and then kill you. :lol:
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

Michael

Quote from: 280Z28 on January 22, 2006, 06:16:36 PM
No, no. compl is a way to get coworkers to  :x and then kill you. :lol:

Yes, it is a possible consequence :D.

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]