[LLVMbugs] [Bug 13190] New: attribute((nonnull)) warnings don't work for function pointers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 24 09:07:03 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13190

             Bug #: 13190
           Summary: attribute((nonnull)) warnings don't work for function
                    pointers
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tss at iki.fi
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


gcc -Wnonnull warns about this code:

void (*bar)(void *x) __attribute__((nonnull));

int main(int argc, char *argv[])
{
    bar(0);
    return 0;
}

test.c: In function ‘main’:
test.c:5:2: warning: null argument where non-null required (argument 1)
[-Wnonnull]

clang gives no warning.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list