llvm-project/lldb/cmake/modules
Martin Storsjö 5560b9e884 [lldb] [CMake] Disable GCC's -Wstringop-truncation warning. NFC.
This warning gives false positives about lldb's correct use of
strncpy to fill fixed length fields that don't need null termination,
in lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp, like this:

    In file included from /usr/include/string.h:495,
                     from /usr/include/c++/9/cstring:42,
                     from ../include/llvm/ADT/StringRef.h:19,
                     from ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:10:
    In function ‘char* strncpy(char*, const char*, size_t)’,
        inlined from ‘lldb::offset_t CreateAllImageInfosPayload(const ProcessSP&, lldb::offset_t, lldb_private::StreamString&, lldb::SaveCoreStyle)’ at ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:6341:16:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 16 equals destination size [-Wstringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

The warning could be squelched locally with

    #pragma GCC diagnostic ignored "-Wstringop-truncation"

too, but Clang also interprets those GCC pragmas, and produces
a -Wunknown-warning-option warning instead. That could be remedied
by wrapping the pragma in an "#ifndef __clang__" - but that makes
things even more messy. Instead, just silence this warning entirely.

Differential Revision: https://reviews.llvm.org/D123254
2022-04-07 12:09:01 +03:00
..
AddLLDB.cmake [lldb] Use `GNUInstallDirs` to support custom installation dirs. 2021-12-22 00:28:53 +00:00
FindCursesAndPanel.cmake
FindLibEdit.cmake Quote some more destination paths with variables 2021-12-13 17:29:08 +00:00
FindLuaAndSwig.cmake [lldb/lua] Force Lua version to be 5.3 2021-10-12 21:34:15 +08:00
FindPythonAndSwig.cmake [lldb] Bump the required SWIG version to 3 2021-01-08 08:47:21 -08:00
LLDBConfig.cmake [lldb] [CMake] Disable GCC's -Wstringop-truncation warning. NFC. 2022-04-07 12:09:01 +03:00
LLDBFramework.cmake [lldb] Remove XPCServices symlinking 2021-03-01 11:23:46 -08:00
LLDBGenerateConfig.cmake [lldb] Get rid of HAVE_SYS_TYPES_H 2021-08-03 22:14:56 +02:00
LLDBStandalone.cmake [cmake] Make include(GNUInstallDirs) always below project(..) 2022-01-20 18:59:17 +00:00
debugserverConfig.cmake