[Openmp-dev] r239337 - Remove unused variables '__kmp_build_check_*'

Jack Howarth howarth.mailing.lists at gmail.com
Wed Jun 10 05:34:03 PDT 2015


Jonathan,
       The attached patch implements the requested change. We needed
to mimic the behavior of the KA_TRACE() macros rather than the
KMP_ASSERT() and KMP_DEBUG_ASSERT() macros. With this change, the
build of openmp in the llvm tree completes on x86_64-apple-darwin14
using clang 3.6.1 without unused-typedef warnings for
__kmp_build_check_* when cmake is passed -DLLVM_ENABLE_ASSERTIONS=OFF.
                     Jack

On Tue, Jun 9, 2015 at 11:52 AM, Jack Howarth
<howarth.mailing.lists at gmail.com> wrote:
> Jonathan,
>       Are you sure that the __kmp_build_check_* symbols generated from
> the KMP_BUILD_ASSERT macros aren't dead code in openmp? I find that
> the following patch eliminates the warnings....
>
> warning: unused typedef '__kmp_build_check_492' [-Wunused-local-typedef]
>
> when the toplevel llvm build is passed-DLLVM_ENABLE_ASSERTIONS=OFF but
> they still remain for -DLLVM_ENABLE_ASSERTIONS=ON.
>                  Jack
>
>
> On Mon, Jun 8, 2015 at 7:54 PM, Jack Howarth
> <howarth.mailing.lists at gmail.com> wrote:
>> Jonathan,
>>      The commit...
>>
>> http://lists.cs.uiuc.edu/pipermail/openmp-commits/2015-June/000339.html
>>
>> only converts the unused-variable warnings for __kmp_build_check_*
>> into unused typedef warnings. My initial inclination was to test
>> adding...
>>
>> #ifdef KMP_USE_ASSERT
>> ...
>> #endif
>>
>> preprocessor wrappers around all of the calls to the KMP_BUILD_ASSERT
>> macro. However this doesn't work since the openmp build passes  -D
>> KMP_USE_ASSERT to the compiler flags in the cmake build of openmp in
>> the llvm tree. This occurs for a cmake build which pass passed
>> -DLLVM_ENABLE_ASSERTIONS=OFF for the top-level cmake options.
>> Shouldn't KMP_USE_ASSERT be disabled in that case or are those two
>> usages of asserts unrelated?
>>               Jack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMP_USE_ASSERT_v3.patch
Type: application/octet-stream
Size: 1412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150610/33fad2dd/attachment.obj>


More information about the Openmp-dev mailing list