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

            Bug ID: 34575
           Summary: __attribute__((__format__(printf()))) doesn't warn
                    about NULL format string
           Product: clang
           Version: 5.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: shab...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Take this code:

    #include <stdio.h>

    int main()
    {
      printf(NULL, "x");
      return 0;
    }

gcc helpfully warns that:

    <source>: In function 'int main()':
    5 : <source>:5:19: warning: null argument where non-null required (argument
1) [-Wnonnull]
       printf(NULL, "x");
                   ^
    5 : <source>:5:19: warning: too many arguments for format
[-Wformat-extra-args]

while clang doesn't say anything (it doesn't even warn about extra arguments).
It would be nice if it did.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to