Re: [xml] [patch] Fix -Wempty-body warning
- From: Nico Weber <thakis chromium org>
- To: veillard redhat com
- Cc: xml gnome org
- Subject: Re: [xml] [patch] Fix -Wempty-body warning
- Date: Mon, 5 Mar 2012 10:12:45 -0800
On Mon, Mar 5, 2012 at 12:38 AM, Daniel Veillard <veillard redhat com> wrote:
On Thu, Mar 01, 2012 at 09:34:30AM -0800, Nico Weber wrote:
Hi,
clang recently grew a warning on `for (...);`. The attached patch
fixes all two instances of this pattern in libxml. The changes don't
change any functionality.
I put the ';' on the next line because that's what similar code in
uri.c already does, but just inserting a front of it gets rid of the
warning as well if you prefer that.
That's really weird. I though clang was parsing the C code,
building a internal representation of the instructions and
working from this. Adding a new line there should not change
the expression graph and not change the output, so I'm starting
to get worried about clang now :-)
Yes, it's a somewhat whacky heuristic. I think the idea is to find stuff like:
while (...);
{
}
The warning was discussed here
http://comments.gmane.org/gmane.comp.compilers.clang.scm/46138 if
you're curious and/or want to chime in.
Patch is fine, pushed,
Thanks!
Nico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]