RESOLVED FIXED Bug 41804
Disable MSVC warning 4288
https://bugs.webkit.org/show_bug.cgi?id=41804
Summary Disable MSVC warning 4288
Dumitru Daniliuc
Reported 2010-07-07 14:51:50 PDT
MSVC has a non-standard extension (/Ze /Zc:forScope) that allows variables declared in for-loops to remain in the "outer" scope: http://msdn.microsoft.com/en-us/library/bk5hc10s.aspx. When the same variable is re-declared after the for-loop, the compiler issues warning C4288. There's also a bug in VS2005 that enables this extension even if the /Zc:forScope option wasn't specified: http://connect.microsoft.com/VisualStudio/feedback/details/338010/bogus-compiler-warning-c4288. Looks like we got hit by that bug, so we need to disable that warning.
Attachments
patch (3.28 KB, patch)
2010-07-07 15:05 PDT, Dumitru Daniliuc
aroben: review+
dumi: commit-queue-
Dumitru Daniliuc
Comment 1 2010-07-07 15:05:22 PDT
Adam Roben (:aroben)
Comment 2 2010-07-07 15:08:37 PDT
Comment on attachment 60785 [details] patch > + MSVC has a non-standard extension (/Ze /Zc:forScope-) that allows > + variables declared in for-loops to remain visible in the same > + scope even after the for-loop > + (http://msdn.microsoft.com/en-us/library/bk5hc10s.aspx). When this > + extension is enabled, re-declaring the same variable in that scope > + results in a C4288 warning. > + > + At the same time, there seems to be a bug in VS2005 that > + erroneously enables /Zc:forScope- even when that option is not > + specified > + (http://connect.microsoft.com/VisualStudio/feedback/details/338010/bogus-compiler-warning-c4288). This makes it sound like the actual behavior gets enabled, not just the warning. Explaining in the previous paragraph that /Ze turns on the behavior and /Zc:forScope- turns on the warning could clear this up, as could changing the description in this paragraph. Other than that, r=me
Dumitru Daniliuc
Comment 3 2010-07-07 15:13:49 PDT
(In reply to comment #2) > (From update of attachment 60785 [details]) > > + MSVC has a non-standard extension (/Ze /Zc:forScope-) that allows > > + variables declared in for-loops to remain visible in the same > > + scope even after the for-loop > > + (http://msdn.microsoft.com/en-us/library/bk5hc10s.aspx). When this > > + extension is enabled, re-declaring the same variable in that scope > > + results in a C4288 warning. > > + > > + At the same time, there seems to be a bug in VS2005 that > > + erroneously enables /Zc:forScope- even when that option is not > > + specified > > + (http://connect.microsoft.com/VisualStudio/feedback/details/338010/bogus-compiler-warning-c4288). > > This makes it sound like the actual behavior gets enabled, not just the warning. Explaining in the previous paragraph that /Ze turns on the behavior and /Zc:forScope- turns on the warning could clear this up, as could changing the description in this paragraph. done. made it more clear that /Ze enables all MSVC extensions and /Zc:forScope- tells the compiler to issue a warning when it sees the same variable declared in a for-loop and then re-declared in the same scope.
Dumitru Daniliuc
Comment 4 2010-07-07 15:20:52 PDT
landed: r62708.
Note You need to log in before you can comment on or make changes to this bug.