Uploaded image for project: 'MariaDB Connector/C++'
  1. MariaDB Connector/C++
  2. CONCPP-134

volatile deprecation build warnings for ServerPrepareResult::shareCounter

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • None
    • 1.0.5, 1.1.6
    • General
    • None

    Description

      When bringing in the the mariadb-connector-cpp code as an internal dependency and building with clang 18.1.x and GCC 14, with warnings cranked up, the following warning is emitted:

      /home/runner/work/server/server/build/_deps/mariadb-connector-cpp-src/src/util/ServerPrepareResult.cpp: In member function 'bool sql::mariadb::ServerPrepareResult::incrementShareCounter()':
      /home/runner/work/server/server/build/_deps/mariadb-connector-cpp-src/src/util/ServerPrepareResult.cpp:157:5: warning: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
        157 |     shareCounter++;
            |     ^~~~~~~~~~~~
      /home/runner/work/server/server/build/_deps/mariadb-connector-cpp-src/src/util/ServerPrepareResult.cpp: In member function 'void sql::mariadb::ServerPrepareResult::decrementShareCounter()':
      /home/runner/work/server/server/build/_deps/mariadb-connector-cpp-src/src/util/ServerPrepareResult.cpp:164:5: warning: '--' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
        164 |     shareCounter--;
            |     ^~~~~~~~~~~~
      

      Access to shareCounter looks to be protected by locks, so it would be safe to remove this volatile qualifier.

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            zach2good Zach Toogood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.