[LLVMbugs] [Bug 18563] New: -Wmissing-prototypes does not work

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 20 16:19:17 PST 2014


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

            Bug ID: 18563
           Summary: -Wmissing-prototypes does not work
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The function "bar()" does not have a prototype. But clang does not warn it.
Please refer to the following steps.

$: cat no-prototype.c
static void bar();

static void foo(void) { bar(); }

void bar(void) {}

int main() {
  foo();
  return 0;
}
$: clang-trunk -Weverything no-prototype.c
$: clang-trunk -Wmissing-prototypes no-prototype.c
$: clang-trunk --version
clang version 3.5 (trunk 199549)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$: gcc-trunk-warn no-prototype.c
no-prototype.c:5:6: warning: no previous prototype for ‘bar’
[-Wmissing-prototypes]
 void bar(void) {}
      ^
$:

-- 
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/20140121/c626a409/attachment.html>


More information about the llvm-bugs mailing list