[Bug 1020] New: Conditional array assignment cause undesired warning message
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1020 Summary: Conditional array assignment cause undesired warning message Product: Swift Version: 0.94 Platform: PC OS/Version: Mac OS Status: ASSIGNED Severity: normal Priority: P2 Component: Error messages AssignedTo: [email protected] ReportedBy: [email protected] CC: [email protected] This script: int j[]; foreach i in [0:9] { if ( i %% 2 == 0 ) { j[i] = 1; } } Causes this warning, which seems undesirable: Warning: Variable j, defined on line 2, might have multiple conflicting writers Swift 0.94 swift-r6414 (swift modified locally) cog-r3648 RunID: 20130612-1541-xzfmeho0 Progress: time: Wed, 12 Jun 2013 15:41:26 +0000 Final status: Wed, 12 Jun 2013 15:41:26 +0000 I propose that this warning be removed. When would such a warning be desirable? -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1020 --- Comment #1 from Mihael Hategan <[email protected]> 2013-07-17 14:04:43 --- int j[]; foreach i in array { if ( i %% 2 == 0 ) { j[i] = 1; } } If array contains a given even value twice, it will result in a double-write. Distinguishing between the two cases when array has unique values (as [0:9] does) vs. when it doesn't was a bit more complicated than I wanted to have in the first iteration of the better write tracking code. -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=1020 Mihael Hategan <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|0.94 |trunk --- Comment #2 from Mihael Hategan <[email protected]> 2013-09-21 03:34:06 --- Moving to trunk. It may be possible to mark certain variables as unique (and certain arrays as having distinct elements) and play with that type of information to control this particular warning. But all in due time, so moving this to trunk. -- Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla-daemon@mcs.anl.gov