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

            Bug ID: 42056
           Summary: missing warning diagnosis for empty expression
                    statement
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: tangyix...@mail.dlut.edu.cn
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

Clang does not warn to remove the empty expression statement with the warning
flag [-Wextra-semi].

For the following example, Clang does not warn to remove the empty expression
statement with the warning flag [-Wextra-semi].
$ cat s.c
int main()
{
    int a = 0;
    ;
    return 0;
}

$ clang --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang -Wextra-semi s.c
No warning generated. 

Under the same workstation:
$ clang-8.0 --Wextra-semi-stmt s.c
s.c:4:5: warning: empty expression statement has no effect; remove unnecessary
';' to silence this warning [-Wextra-semi-stmt]
    ;
    ^
1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to