Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57206

Compiler warnings in JSStringWrapper::JSStringWrapper

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Dev Platform 2021-06-14

      Description

      I got a compiler warning below when building from source

      In file included from /usr/include/string.h:494,
      from /usr/include/c++/9/cstring:42,
      from src/third_party/mozjs-60/include/mozilla/Span.h:33,
      from src/third_party/mozjs-60/include/mozilla/Range.h:12,
      from src/third_party/mozjs-60/include/jsapi.h:15,
      from src/mongo/scripting/mozjs/jsstringwrapper.h:33,
      from src/mongo/scripting/mozjs/jsstringwrapper.cpp:32:
      In function 'char* strncpy(char*, const char*, size_t)',
      inlined from 'mongo::mozjs::JSStringWrapper::JSStringWrapper(int32_t)' at src/mongo/scripting/mozjs/jsstringwrapper.cpp:48:12:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 64 equals destination size [-Werror=stringop-truncation]
      106 | return _builtin_strncpy_chk (dest, __src, __len, __bos (_dest));

      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              acm Andrew Morrow
              Reporter:
              1975643103@qq.com Yingdong Yuan
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: