[llvm-bugs] [Bug 41851] New: -Wstrict-prototypes doesn't seem to warn on definitions

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 12 08:48:29 PDT 2019


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

            Bug ID: 41851
           Summary: -Wstrict-prototypes doesn't seem to warn on
                    definitions
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ndesaulniers at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk, srhines at google.com

// $ clang -O2 -Wstrict-prototypes
// $ gcc -O2 -Wstrict-prototypes

int puts(const char*);

void f();
void g() { puts("foo"); }

void h() {
    f(1, 2);
};

void i() {
    g(1, 2);
};

void f(int a) { puts((const char*)(long)a); };

// clang warns on f
// gcc warns on f, g, h, i

// https://godbolt.org/z/IORbBb

-- 
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/20190512/59c263bd/attachment.html>


More information about the llvm-bugs mailing list