[Rivet] minor patch for Rivet for gcc45/c++0x

Hendrik Hoeth hendrik.hoeth at cern.ch
Fri Feb 11 15:25:58 GMT 2011


Hi Peter,

thanks for you minimal example. I now can reproduce the behaviour you
see. Looking at the C++ standard we believe the code in Rivet is
formally correct. Nevertheless I will apply your change, since it
doesn't change anything, and it helps you.

However, coming back to your compile error: You are using -ansi (which
is equivalent to -std=c++98, i.e. the 1998 ISO C++ standard plus
amendments) and then _later_ -std=c++0x (which is the working draft of
the upcoming ISO C++0x standard, i.e. _not_ a standard yet), thereby
overriding the -ansi option. Hence you are working outside any valid C++
standard. From the g++ man page:

  "This option enables experimental features that are likely to be
   included in C++0x. The working draft is constantly changing, and
   any feature that is enabled by this flag may be removed from
   future versions of GCC if it is not part of the C++0x standard."

Rivet compiles fine even with CXX="g++ -std=c++0x" because we use -ansi
later in the options, overriding the c++0x choice.

I also consider this a gcc bug, since the construct we are using should
still be valid in the upcoming C++0x standard.

Cheers,

    Hendrik

-- 
It pays to be obvious, especially if you have
a reputation for subtlety.    -- Isaac Asimov


More information about the Rivet mailing list