[LLVMbugs] [Bug 18877] No -Wempty-body warning for empty body with a prefix label
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Feb 18 11:26:10 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18877
Chengnian Sun <chengniansun at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |---
--- Comment #2 from Chengnian Sun <chengniansun at gmail.com> ---
(In reply to comment #1)
> Right. This warning is to detect the 'stray semicolon' bug:
>
> if (foo);
> blah;
>
> The labelled semicolon case doesn't match this pattern.
Hi Richard,
Thanks. I understand why it is not warned, but I do not understand why the
given test case with an empty body does not fit into -Wempty-body.
The pattern makes sense, but is it a little conservative? For the if statement
"if (i) a:;", the programmer cannot easily find out that it is an empty
statement due to the labelled semicolon, which is equally bad to the stray
semicolon.
--
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/20140218/e0c6f9c4/attachment.html>
More information about the llvm-bugs
mailing list