[Webkit-unassigned] [Bug 40001] Fix "variable may be used before being set" warning in TextResourceDecoder::checkForHeadCharset

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 2 10:00:17 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40001


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com




--- Comment #5 from Darin Adler <darin at apple.com>  2010-06-02 10:00:15 PST ---
(In reply to comment #0)
> The warning is coming from the RVCT compiler:
> 
> "\webkit\WebCore\loader\textresourcedecoder.cpp", line 571: Warning: C2874W: len may be used before being set
>         int len;
>             ^
> Checking the code revealed that this might be a limitation of the compiler as the code is correct and the value of len never read before it gets initialized. I propose to initialize len to 0 just to eliminate the false compiler warning.

I'm not sure this is a good precedent. It's OK to change code to sidestep a mistaken warning, but this is the kind of thing that occurs in many places and I don't want to include lots of extra initialization just to quiet the compiler.

Unless you think there's another reason that this kind of code change is good.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list