-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
| Bugzilla Link | 18877 |
| Version | trunk |
| OS | Windows NT |
| CC | @zygoloid,@zhendongsu |
Extended Description
For the following statement:
if (i) a:;
Clang does not warn that the body is empty.
$: cat s.c
void f(int i) {
if (i) a:;
}
$: clang-trunk -Wempty-body -c s.c
$: gcc-trunk -Wempty-body -c s.c
s.c: In function ‘f’:
s.c:2:12: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
if (i) a:;
^
$: clang-trunk --version
clang version 3.5 (trunk 201498)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer