[CMake] Disable -Wstringop-overflow
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Mon, 30 Jul 2018 18:16:22 +0000 (18:16 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Mon, 30 Jul 2018 18:16:22 +0000 (18:16 +0000)
commitf985f9812847628a107d72b6a8e38a6b0720c706
treec39e9d09fb742002eaf5549a2ac9766e7347fbb9
parent91c89c5e2c069c1a8aeb76bb545be3a405c87c5e
[CMake] Disable -Wstringop-overflow

GCC 8 produces false-positives with this:
In file included from <openmp>/src/runtime/src/kmp_os.h:950,
                 from <openmp>/src/runtime/src/kmp.h:78,
                 from <openmp>/src/runtime/src/kmp_environment.cpp:54:
<openmp>/src/runtime/src/kmp_environment.cpp: In function ‘char* __kmp_env_get(const char*)’:
<openmp>/src/runtime/src/kmp_safe_c_api.h:52:50: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
 #define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt)
                                           ~~~~~~~^~~~~~~~~~~~~~~
<openmp>/src/runtime/src/kmp_environment.cpp:97:5: note: in expansion of macro ‘KMP_STRNCPY_S’
     KMP_STRNCPY_S(result, len, value, len);
     ^~~~~~~~~~~~~
<openmp>/src/runtime/src/kmp_environment.cpp:92:28: note: length computed here
     size_t len = KMP_STRLEN(value) + 1;

This is stupid because result is allocated with KMP_INTERNAL_MALLOC(len),
so the arguments are correct.

Differential Revision: https://reviews.llvm.org/D49904

llvm-svn: 338283
openmp/runtime/cmake/LibompHandleFlags.cmake
openmp/runtime/cmake/config-ix.cmake