This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP] fix build failure with GCC4.8
AbandonedPublic

Authored by kkwli0 on Feb 6 2019, 2:31 PM.

Details

Summary

The change in kmp-os.h in https://reviews.llvm.org/D56397 causes build failure with GCC4.8 as the build compiler. This patch is to introduce a guard to get it compiled.

/gsa/tlbgsa/home/k/l/kli/llvm-project/openmp/runtime/src/kmp_os.h:303:49: error: missing binary operator before token "("
 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
                                                 ^
/gsa/tlbgsa/home/k/l/kli/llvm-project/openmp/runtime/src/kmp_os.h:305:26: error: missing binary operator before token "("
 #elif __has_cpp_attribute(clang::fallthrough)
                          ^
/gsa/tlbgsa/home/k/l/kli/llvm-project/openmp/runtime/src/kmp_os.h:307:22: error: missing binary operator before token "("
 #elif __has_attribute(fallthough) || _GNUC_VER >= 700
                      ^

Diff Detail

Event Timeline

kkwli0 created this revision.Feb 6 2019, 2:31 PM

As said in D57851, this will not handle Clang and only work for GCC.

openmp/runtime/src/kmp_os.h
308

This change seems right, _GNUC_VER is not defined here!

kkwli0 abandoned this revision.Feb 7 2019, 9:16 AM

Will consolidate the review and patch in https://reviews.llvm.org/D57851 .