|
[Rivet] minor patch for Rivet for gcc45/c++0xPeter Elmer Peter.Elmer at cern.chFri Feb 11 14:29:35 GMT 2011
Hi Hendrik, On Fri, Feb 11, 2011 at 01:57:30PM +0000, Hendrik Hoeth wrote: > Thus spake Peter Elmer (Peter.Elmer at cern.ch): > > > Are you sure this is gcc 4.5.1? With the stock gcc 4.5.1 build (not any > > RH almost-gcc451) it doesn't compile. (And is arguably not correct, I > > think, although I'm not a C++ lawyer.) I'm fairly certain that this is > > not an error in our code as such. > > [13:43] hoeth at prometheus:~ $ gcc --version > gcc (GCC) 4.5.1 > Copyright (C) 2010 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. > [13:43] hoeth at prometheus:~ $ > > Built from ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.5.1/gcc-4.5.1.tar.bz2 > with no additional patches applied. Yes, I'm pretty darn sure that this > is a real gcc-4.5.1 and that no distribution specific patches made it > into any part of my system, since I'm not using a distribution. In fact > I can give you the exact configure and install options for my whole > toolchain if you want. > > On the other hand you haven't even told us whether you see an error or > just a warning, let alone the actual compiler output. If you want us to > follow up on this, please provide us with a minimal example that shows > the behaviour you see (whatever that might be). You know, in God we > trust, all others have to provide data. It is a compilation error. As I said, I think the C++ syntax used there is possibly incorrect, regardless of the error we see. (But I wouldn't head to the human rights court in Strasbourg about it...) In any case, I looked back at this particular instance of the error and in fact it comes from something slightly different than other instances: it comes merely from the fact that we include the header, regardless of whether we actually use the function. A slightly simpler example of the errorjust including the header (although I'm pointing to our includes for hepmc, boost, gsl, etc., but presumably you can do the equivalent). Can you at least reproduce it with this example? [It might be fixable by additional includes or declarations in the header file, but again I'm not sure the syntax you are using is correct.] Pete (a) Simple test case where header is included: lxbuild117> cat test.cc #include "Rivet/Analysis.hh" int foo(int i) { return 2*i; } compiles fine without -std=c++0x, but fails with it: lxbuild117> /build/40M/slc5_amd64_gcc451/external/gcc/4.5.1/bin/c++ -I/build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include -I/build/40M/slc5_amd64_gcc451/external/hepmc/2.05.01/include -I/build/40M/slc5_amd64_gcc451/external/boost/1.45.0-cms2/include -I/build/40M/slc5_amd64_gcc451/external/gsl/1.10/include -O2 -pedantic -ansi -pthread -pipe -Werror=overflow -Wall test.cc -c -o foo.o lxbuild117> /build/40M/slc5_amd64_gcc451/external/gcc/4.5.1/bin/c++ -I/build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include -I/build/40M/slc5_amd64_gcc451/external/hepmc/2.05.01/include -I/build/40M/slc5_amd64_gcc451/external/boost/1.45.0-cms2/include -I/build/40M/slc5_amd64_gcc451/external/gsl/1.10/include -O2 -pedantic -ansi -pthread -pipe -Werror=overflow -Wall -std=c++0x test.cc -c -o foo.o In file included from /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/Rivet.hh:49:0, from /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/Analysis.hh:5, from test.cc:1: /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/ParticleName.hh: In function 'std::pair<int, int> Rivet::make_pdgid_pair(Rivet::PdgId, Rivet::PdgId)': /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/ParticleName.hh:154:39: error: no matching function for call to 'make_pair(Rivet::PdgId&, Rivet::PdgId&)' /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/ParticleName.hh: In function 'std::pair<int, int> Rivet::make_pdgid_pair(const std::string&, const std::string&)': /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/ParticleName.hh:162:41: error: no matching function for call to 'make_pair(const Rivet::PdgId&, const Rivet::PdgId&)' /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/Math/MathHeader.hh: At global scope: /build/40M/slc5_amd64_gcc451/external/rivet/1.4.0/include/Rivet/Math/MathHeader.hh:40:16: warning: 'Rivet::MAXINT' defined but not used ------------------------------------------------------------------------- Peter Elmer E-mail: Peter.Elmer at cern.ch Phone: +41 (22) 767-4644 Address: CERN Division PPE, Bat. 32 2C-14, CH-1211 Geneva 23, Switzerland -------------------------------------------------------------------------
More information about the Rivet mailing list |