[llvm-bugs] [Bug 40023] New: format security warnings not generated for printf calls in template
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Fri Dec 14 07:24:06 PST 2018
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=40023
            Bug ID: 40023
           Summary: format security warnings not generated for printf
                    calls in template
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yshuiv7 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk
Code example:
#include <string>
#include <cstdio>
template <typename ...Args>
void p(const char *fmt, const Args & ... args) {
    std::printf(fmt, args...);
}
int main() {
    //p("asdfasdf"); // warning generated for this one
    p("%d", 1); // but not this one
}
compiler explorer link: https://godbolt.org/z/O8mCQj
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181214/7ae158b6/attachment.html>
    
    
More information about the llvm-bugs
mailing list