src/mongo/db/exec/sbe/vm/vm_memory.h is not including used headers

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using clang-query, the header is considered in isolation and the following errors are reported:

      /workspaces/mongo/src/mongo/db/exec/sbe/vm/vm_memory.h:41:24: error: unknown type name 'uint8_t'
         41 | T readFromMemory(const uint8_t* ptr) noexcept {
            |                        ^
      /workspaces/mongo/src/mongo/db/exec/sbe/vm/vm_memory.h:42:20: error: no template named 'IsEndian'
         42 |     static_assert(!IsEndian<T>::value);
            |                    ^
      /workspaces/mongo/src/mongo/db/exec/sbe/vm/vm_memory.h:53:1: error: unknown type name 'size_t'
         53 | size_t writeToMemory(void* ptr, const T& val) noexcept {
            | ^
      /workspaces/mongo/src/mongo/db/exec/sbe/vm/vm_memory.h:54:20: error: no template named 'IsEndian'
         54 |     static_assert(!IsEndian<T>::value);
            |                    ^

      This can be fixed by adding the missing headers.

      In server code, the header is always included after others, so it's just coincidence this is not a compilation error.

            Assignee:
            Unassigned
            Reporter:
            Niels Lohmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: