https://llvm.org/bugs/show_bug.cgi?id=27493
Bug ID: 27493 Summary: -Wdeclaration-after-statement not working Product: clang Version: 3.7 Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: j...@iki.fi CC: llvm-bugs@lists.llvm.org Classification: Unclassified $ cat das.c int foo() { if (0) {} int i = 42; return i; } $ clang-mp-3.7 -Wdeclaration-after-statement -c das.c Nothing. As opposed to: gcc-mp-5 -Wdeclaration-after-statement -c das.c das.c: In function 'foo': das.c:3:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int i = 42; ^ Note that I'm using the macports clang and gcc. Their versions: $ clang-mp-3.7 -v clang version 3.7.1 (tags/RELEASE_371/final) Target: x86_64-apple-darwin15.4.0 Thread model: posix $ gcc-mp-5 -v ... gcc version 5.3.0 (MacPorts gcc5 5.3.0_0) I tried clangs 3.4, 3.5, 3.6, the same result of no warning. I tried gccs 4.3, 4.4, 4.5, 4.6, 4.8, 4.9, emit the warning. I also finally tried clang 3.4 on a Ubuntu precise VM, the same result of no warning. Don't have a clang 3.8 installation available. -- 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