Summary: | Compiler warning for XMLTokenizerLibxml2.cpp | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Craig Schlenter <craig.schlenter> | ||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
Craig Schlenter
2009-03-12 10:32:23 PDT
Created attachment 28532 [details]
patch to fix compiler warning
untested patch to fix compiler warning
Comment on attachment 28532 [details]
patch to fix compiler warning
Is this really the only unused result warning in WebCore? If not, then why are we fixing this one case?
I've asked the original reporter for more feedback in the chromium issue tracker to see if there are other warnings/errors. I had originally assumed that one of the webkit merges introduced this problem but the vasprintf seems to have been there for ages according to svn blame so I need to dig a bit more to see why it's only showing up now as the reporter was compiling successfully before. I unfortunately don't have the same compiler as the reporter btw. but I'll see if I can coax my machine (Fedora 9) into using a newer compiler and investigate this properly. In this particular case btw., if the vasprintf call fails the invalid buffer returned by vasprintf will be freed a couple of lines further on which will probably result in a crash although arguably if that is failing not much else is likely to work either. Thank you. I think I know why the chromium reporter sees this and I don't even after upgrading my fedora 9 system to gcc 4.4.0 and glibc-2.9.90 ... it seems as if ubuntu 8.10 has some default compiler flag settings that include FORTIFY_SOURCE that is activated at -O2 and higher: https://wiki.ubuntu.com/CompilerFlags I'll fiddle with getting my machine into equivalent shape tomorrow and track down the related errors/warnings .... After compiling with -D_FORTIFY_SOURCE=2 this seems to be the only warn_unused_result. GCC-4.4.0 has shown up some other issues (a missing include and possibly some strict aliasing issues) but I'll file separate bugs for those. Thank you. Comment on attachment 28532 [details]
patch to fix compiler warning
Sounds good.
Landed: http://trac.webkit.org/changeset/42139 Please add the link to the bug into ChangeLog description next time. |