diff --git a/cmake/BayeuxDependencies.cmake b/cmake/BayeuxDependencies.cmake index 6f31339c2..472ca86e9 100644 --- a/cmake/BayeuxDependencies.cmake +++ b/cmake/BayeuxDependencies.cmake @@ -76,6 +76,8 @@ endif() if (Boost_VERSION VERSION_GREATER_EQUAL 107400) message(STATUS "Forcing BOOST_BIND_GLOBAL_PLACEHOLDERS...") add_definitions("-DBOOST_BIND_GLOBAL_PLACEHOLDERS") + # 2024-09-06 FM: disable for boost/spirit/include/phoenix_core.hpp and others... + add_definitions("-DBOOST_ALLOW_DEPRECATED_HEADERS") endif() foreach(_boost_lib ${BAYEUX_BOOST_COMPONENTS}) diff --git a/source/bxdatatools/testing/test_enriched_base.cxx b/source/bxdatatools/testing/test_enriched_base.cxx index 094ebc2ba..66d54fd9a 100644 --- a/source/bxdatatools/testing/test_enriched_base.cxx +++ b/source/bxdatatools/testing/test_enriched_base.cxx @@ -17,6 +17,7 @@ #include #if DATATOOLS_WITH_REFLECTION == 1 +#include // for __GNUC_VERSION__ // - Camp: #include #include @@ -30,13 +31,6 @@ void test2(); void test_reflection(); #endif // DATATOOLS_WITH_REFLECTION == 1 -#if defined(__GNUG__) -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif -#if defined(__clang__) -#pragma clang diagnostic ignored "-Werror=dangling-reference" -#endif - int main(int /* argc_ */, char ** /* argv_ */) { int error_code = EXIT_SUCCESS; @@ -100,10 +94,28 @@ void test2() } #if DATATOOLS_WITH_REFLECTION == 1 +#if defined(__GNUG__) +#if GCC_VERSION >= 13 +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif +#endif void test_reflection() { std::cerr << "\n******** Entering test_reflection... " << std::endl; +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & aoMetaClass = camp::classByName("datatools::enriched_base"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic pop +// #endif +// #endif std::cerr << "******** Go. " << std::endl; camp::UserObject aoObj = aoMetaClass.construct(); diff --git a/source/bxdatatools/testing/test_handle_operators.cxx b/source/bxdatatools/testing/test_handle_operators.cxx index 11e9326f5..fcbb29170 100644 --- a/source/bxdatatools/testing/test_handle_operators.cxx +++ b/source/bxdatatools/testing/test_handle_operators.cxx @@ -114,8 +114,12 @@ bool test_handle_deref_operator() x.reset(); bool gotException{false}; try { - auto sz = x->size(); - std::clog << "sz=" << sz << '\n'; +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-value" + x->size(); +#pragma GCC diagnostic pop +#endif } catch (std::logic_error& e) { //o.k., we've caught the expected error gotException = true; diff --git a/source/bxdatatools/testing/test_reflection_0.cxx b/source/bxdatatools/testing/test_reflection_0.cxx index 427cb1f11..595aecba2 100644 --- a/source/bxdatatools/testing/test_reflection_0.cxx +++ b/source/bxdatatools/testing/test_reflection_0.cxx @@ -24,12 +24,13 @@ #include #include #include +#include // for __GNUC_VERSION__ -#if defined(__GNUG__) -#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 +#pragma message "GCC13 workaround : applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic ignored "-Wdangling-reference" #endif -#if defined(__clang__) -#pragma clang diagnostic ignored "-Werror=dangling-reference" #endif void test_things(bool /*debug_*/); @@ -92,7 +93,20 @@ void test_things (bool /*debug_*/) std::clog << "*** test_things : " << std::endl; // Access meta class for class 'things' : +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & tMetaClass = camp::classByName("datatools::things"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Restoring original diagnostic conditions" +// #pragma GCC diagnostic pop +// #endif +// #endif { // Allocate a new 'things' object from the metaclass factory @@ -155,7 +169,20 @@ void test_things (bool /*debug_*/) void test_multi_properties (bool /*debug_*/) { std::clog << "*** test_multi_properties : " << std::endl; +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & mpropsMetaClass = camp::classByName("datatools::multi_properties"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic pop +// #endif +// #endif { camp::UserObject mpropsObj = mpropsMetaClass.construct(camp::Args ("id", "class")); @@ -212,7 +239,20 @@ void test_multi_properties (bool /*debug_*/) void test_properties (bool /*debug_*/) { std::clog << "*** test_properties : " << std::endl; +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & propsMetaClass = camp::classByName("datatools::properties"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic pop +// #endif +// #endif { //boost::scoped_ptr props (propsMetaClass.construct (camp::Args ("A test properties"))); @@ -256,7 +296,20 @@ void test_properties (bool /*debug_*/) void test_event_id (bool /*debug_*/) { std::clog << "*** test_event_id : " << std::endl; +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & evIdMetaClass = camp::classByName("datatools::event_id"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic pop +// #endif +// #endif { //boost::scoped_ptr evId (evIdMetaClass.construct (camp::Args (3, 55))); @@ -290,7 +343,20 @@ void test_logger (bool /*debug_*/) { std::clog << "*** test_logger : " << std::endl; { +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic push +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif const camp::Class & tMetaClass = camp::classByName("datatools::logger"); +// #if defined(__GNUC__) +// #if __GNUC_VERSION__ >= 130000 +// // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +// #pragma GCC diagnostic pop +// #endif +// #endif std::clog << "tMetaClass = " << tMetaClass.name() << std::endl; try { diff --git a/source/bxgenbb_help/programs/genbb_inspector.cxx b/source/bxgenbb_help/programs/genbb_inspector.cxx index 77030a67f..4e9f62a23 100644 --- a/source/bxgenbb_help/programs/genbb_inspector.cxx +++ b/source/bxgenbb_help/programs/genbb_inspector.cxx @@ -89,12 +89,12 @@ #include #include #include +#include // for __GNUC_VERSION__ #if defined(__GNUG__) -#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#if GCC_VERSION >= 13 +#pragma GCC diagnostic ignored "-Wdangling-reference" #endif -#if defined(__clang__) -#pragma clang diagnostic ignored "-Werror=dangling-reference" #endif namespace dtc = datatools::configuration; diff --git a/source/bxgenbb_help/testing/test_reflection_0.cxx b/source/bxgenbb_help/testing/test_reflection_0.cxx index 74cf9d211..b58522a9b 100644 --- a/source/bxgenbb_help/testing/test_reflection_0.cxx +++ b/source/bxgenbb_help/testing/test_reflection_0.cxx @@ -18,11 +18,18 @@ // - Bayeux/datatools: #include #include +#include // for __GNUC_VERSION__ // Introspectable classes : #include #include +// #if defined(__GNUG__) +// #if GCC_VERSION >= 13 +// #pragma GCC diagnostic ignored "-Wdangling-reference" +// #endif +// #endif + void test_primary_particle(); void test_primary_event(); @@ -61,7 +68,20 @@ int main (int /* argc_ */, char ** /* argv_ */) void test_primary_particle() { datatools::logger::priority logging = datatools::logger::PRIO_NOTICE; +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif +#endif const camp::Class & ppMetaClass = camp::classByName("genbb::primary_particle"); +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic pop +#endif +#endif camp::UserObject partObj0 = ppMetaClass.construct(); DT_LOG_NOTICE(logging, "Initializing the primary particle object..."); @@ -87,7 +107,20 @@ void test_primary_particle() void test_primary_event() { //datatools::logger::priority logging = datatools::logger::PRIO_NOTICE; +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif +#endif const camp::Class & peMetaClass = camp::classByName("genbb::primary_event"); +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic pop +#endif +#endif camp::UserObject eventObj0 = peMetaClass.construct(); diff --git a/source/bxgeomtools/testing/test_reflection_0.cxx b/source/bxgeomtools/testing/test_reflection_0.cxx index b726a5a2c..a1d52f939 100644 --- a/source/bxgeomtools/testing/test_reflection_0.cxx +++ b/source/bxgeomtools/testing/test_reflection_0.cxx @@ -22,6 +22,7 @@ // - Bayeux/datatools: #include #include +#include // for __GNUC_VERSION__ // Introspectable classes : #include @@ -29,11 +30,30 @@ #include #include +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 +#pragma message "GCC13 workaround : applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif +#endif void test_placement() { datatools::logger::priority logging = datatools::logger::PRIO_NOTICE; +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif +#endif const camp::Class & plctMetaClass = camp::classByName("geomtools::placement"); +#if defined(__GNUC__) +#if __GNUC_VERSION__ >= 130000 + // #pragma message "Applying special diagnostic ignored '-Wdangling-reference'" +#pragma GCC diagnostic pop +#endif +#endif camp::UserObject plctObj0 = plctMetaClass.construct();