Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2686

Fails to compile with GCC 13.0.1

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.7.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Compilation of C++ driver fails with GCC 13.0.1

      C++ driver is missing include headers for some C++ standard integers.
       

      FAILED: src/mongocxx/CMakeFiles/mongocxx_shared.dir/events/heartbeat_started_event.cpp.o
      /usr/bin/c++ -DMONGOCXX_EXPORTS -DMONGO_CXX_DRIVER_COMPILING -I/include -I/home/mark/src/mongo-cxx-driver/src/mongocxx/.. -I/home/mark/src/mongo-cxx-driver/cmake-build/src/mongocxx/.. -I/home/mark/src/mongo-cxx-driver/cmake-build/src/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core/include -I/home/mark/src/usr/include/bsoncxx/v_noabi -I/home/mark/src/mongo-cxx-driver/src/bsoncxx/.. -I/home/mark/src/mongo-cxx-driver/cmake-build/src/bsoncxx/.. -isystem /home/mark/src/usr/include/libmongoc-1.0 -isystem /home/mark/src/usr/include/libbson-1.0 -O2 -g -DNDEBUG -std=c++11 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT src/mongocxx/CMakeFiles/mongocxx_shared.dir/events/heartbeat_started_event.cpp.o -MF src/mongocxx/CMakeFiles/mongocxx_shared.dir/events/heartbeat_started_event.cpp.o.d -o src/mongocxx/CMakeFiles/mongocxx_shared.dir/events/heartbeat_started_event.cpp.o -c /home/mark/src/mongo-cxx-driver/src/mongocxx/events/heartbeat_started_event.cpp
      In file included from /home/mark/src/mongo-cxx-driver/src/mongocxx/events/heartbeat_started_event.cpp:15:
      /home/mark/src/mongo-cxx-driver/src/mongocxx/../mongocxx/events/heartbeat_started_event.hpp:54:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
         54 |     std::uint16_t port() const;
            |          ^~~~~~~~
            |          wint_t
      /home/mark/src/mongo-cxx-driver/src/mongocxx/events/heartbeat_started_event.cpp:33:15: error: no declaration matches ‘uint16_t mongocxx::v_noabi::events::heartbeat_started_event::port() const’
         33 | std::uint16_t heartbeat_started_event::port() const {
            |               ^~~~~~~~~~~~~~~~~~~~~~~
      /home/mark/src/mongo-cxx-driver/src/mongocxx/events/heartbeat_started_event.cpp:33:15: note: no functions named ‘uint16_t mongocxx::v_noabi::events::heartbeat_started_event::port() const’
      /home/mark/src/mongo-cxx-driver/src/mongocxx/../mongocxx/events/heartbeat_started_event.hpp:33:20: note: ‘class mongocxx::v_noabi::events::heartbeat_started_event’ defined here
         33 | class MONGOCXX_API heartbeat_started_event {
            |                    ^~~~~~~~~~~~~~~~~~~~~~~
      ...
       

      Environment

      Please provide the version of the C / CXX driver.

      commit 52a1150d6fcb8211a6fe6652813441551da3a63e (HEAD -> master, origin/master)
      Author: Kevin Albertson <kevin.albertson@mongodb.com>
      Date: Fri Apr 28 14:38:28 2023 +0000

      Please provide the host OS, version, and architecture (example: Windows 10 64-bit x86).

      Fedora 38

      Please provide the C / CXX compiler and version.

      $ gcc --version
      gcc (GCC) 13.0.1 20230401 (Red Hat 13.0.1-0)
      Copyright (C) 2023 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.

      If applicable, please attach the full output of the cmake command used to configure the C / CXX driver.

       

      How to Reproduce

      Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example

      mkdir cmake-build
      cd cmake-build
      cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/home/mark/src/usr -GNinja ..
      ninja
      

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            kyle.kloberdanz@mongodb.com Kyle Kloberdanz (Inactive)
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: