Errors during compilation | Cassandra C++ driver 2.17.1

20 views
Skip to first unread message

Sonal Sharma

unread,
Jun 28, 2024, 7:01:51 AM6/28/24
to DataStax C++ Driver for Apache Cassandra User Mailing List
Hello Team,

We need code base which is compatible to C++98/C++03 compiler?
The latest version 2.17.1 of Datastax C++ driver is not compatible with C++03 compiler as it has code specific to C++11.

One of the compilation error we have got is as listed below:
Error:
/workarea/MM/EM21_3PP_LCM/EM21.11/cassandra/cpp-driver-2.17.1/src/metrics.hpp: In constructor 'datastax::internal::core::Metrics::Histogram::Histogram(datastax::internal::core::Metrics::ThreadState*, unsigned int)':
/workarea/MM/EM21_3PP_LCM/EM21.11/cassandra/cpp-driver-2.17.1/src/metrics.hpp:275:35: error: extended initializer lists only available with -std=c++11 or -std=gnu++11 [-Werror]
         , zero_snapshot_(Snapshot {0,0,0,0,0,0,0,0,0,0}) {
                                   ^
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/cassandra.dir/build.make:230: src/CMakeFiles/cassandra.dir/client_insights.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:191: src/CMakeFiles/cassandra.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

###########################################################################################################################3

Cassandra CPP driver (2.17.1)  having code specific to C++11 :
Histogram(ThreadState* thread_state, unsigned refresh_interval = CASS_DEFAULT_HISTOGRAM_REFRESH_INTERVAL_NO_REFRESH)
        : thread_state_(thread_state)
        , histograms_(new PerThreadHistogram[thread_state->max_threads()])
        , zero_snapshot_(Snapshot {0,0,0,0,0,0,0,0,0,0}) {

      refresh_interval_ = refresh_interval;
      refresh_timestamp_ = get_time_since_epoch_ms();
      cached_snapshot_ = zero_snapshot_;

      hdr_init(1LL, HIGHEST_TRACKABLE_VALUE, 3, &histogram_);
      uv_mutex_init(&mutex_);
    }

Regards
Sonal Sharma

Bret McGuire

unread,
Jul 10, 2024, 12:56:32 PM7/10/24
to DataStax C++ Driver for Apache Cassandra User Mailing List, sonal8...@gmail.com
   Hey Sonal, thanks for the report!

   It took a bit of digging but it does look like we lost reliable testing against the C++98 standard with the platform upgrades we recently completed for 2.17.0 (more on that in CPP-957).  I thought we still had coverage of this case from CentOS 7 but I forgot to account for the override for std::atomic... which means we're also testing against C++11 on that platform as well.  I've opened CPP-1000 to resolve that issue as part of work on the next release.

   I'll also mention the previous conversation asking for feedback around bumping our minimum supported C++ standard to C++11 or C++14.  I'll very likely be revisiting that conversation at some point in the future, although I definitely want input from our users on this point.

   Thanks again!

   - Bret - 
Reply all
Reply to author
Forward
0 new messages