https://llvm.org/bugs/show_bug.cgi?id=23347

            Bug ID: 23347
           Summary: Don't issue -Wtautological-pointer-compare with
                    -weak_framework
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The recommended way to check for symbols of a framework linked with
"-weak_framework" is:

  if (MyWeakLinkedFunction != NULL) {
    ...
  }

This is according to Apple docs:
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

However, recent clang version (from Xcode 6.3.1) say:

  error: comparison of function 'MyWeakLinkedFunction' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
  if (MyWeakLinkedFunction != NULL) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~
  note: prefix with the address-of operator to silence this warning
  if (MyWeakLinkedFunction != NULL) {
      ^
      &

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to