From 50abdc7349b3dde6136ae655a5d306d77226b2ed Mon Sep 17 00:00:00 2001 From: alessandro Date: Fri, 31 Jul 2015 14:30:27 +0200 Subject: [PATCH] Fix warning raised by deprecated use of tmpnam. Substituted by boost equivalent "unique_path" of namespace boost::filesystem. --- PhysicsTools/MVAComputer/plugins/ProcTMVA.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/MVAComputer/plugins/ProcTMVA.cc b/PhysicsTools/MVAComputer/plugins/ProcTMVA.cc index a4f426f471054..f0f3dca461245 100644 --- a/PhysicsTools/MVAComputer/plugins/ProcTMVA.cc +++ b/PhysicsTools/MVAComputer/plugins/ProcTMVA.cc @@ -36,6 +36,8 @@ #include "PhysicsTools/MVAComputer/interface/mva_computer_define_plugin.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include + using namespace PhysicsTools; namespace { // anonymous @@ -108,7 +110,7 @@ ProcTMVA::ProcTMVA(const char *name, ( reader->BookMVA( methodType, weight_text.c_str() ) ) ); } else { // Write to a temporary file - TString weight_file_name(std::tmpnam(NULL)); + TString weight_file_name(boost::filesystem::unique_path().c_str()); std::ofstream weight_file; weight_file.open(weight_file_name.Data()); weight_file << weight_text;