Skip to content
Prev 2748 / 10988 Next

[Rcpp-devel] Using C++0x in g++ changes ifelse behaviour

Thanks Dirk.
I tried with your line and it works for me too. So I tried shortening it
and this works:
  CXXFLAGS= -std=c++0x -g -O3

but this does not:
  CXXFLAGS= -std=c++0x -g

This also does not work:
  CXXFLAGS= -std=c++0x -g -Wall -pipe -pedantic -Wno-variadic-macros

And neither does this:
  CXXFLAGS= -g -Wall -pipe -pedantic -Wno-variadic-macros

I.e. c++0x was a red herring, and the lack of -O3 is the problem. It
works with -O3, -O2, -O1 and -Os, but fails to work with -O0.

Very curious. I considered trying each of the individual optimization
flags [1], to narrow it down further, until I realized how many of them
there were.

Darren

[1]: http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html