| Summary: | Assignment in condition checker matches the whole expression | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Gil Barash <scobido1984> |
| Component: | cdt-codan | Assignee: | Nathan Ridge <zeratul976> |
| Status: | VERIFIED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, malaperle, yevshif, zeratul976 |
| Version: | 8.0 | ||
| Target Milestone: | 8.2.1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Gil Barash
Let me remind that this happens because it is parsed as (a == 1 && b) = 2. I agree that this needs to be cleverly handled. More test similar cases would be useful. Can you think of any similar but different situations where substituting = by == would change the operator order? (In reply to comment #1) > Let me remind that this happens because it is parsed as (a == 1 && b) = 2. I > agree that this needs to be cleverly handled. > > More test similar cases would be useful. Can you think of any similar but > different situations where substituting = by == would change the operator > order? This warning is predicated on the assumption that the user intended == rather than =. It follows, then, that the user also intended the precedence that comes with == rather than the precedence that comes with =. *** cdt git genie on behalf of Nathan Ridge ***
Bug 352267 - Assignment in condition checker matches the whole
expression
Change-Id: I7aea1c5d404a8d374020e34c997e6e890fcdb3d6
Signed-off-by: Nathan Ridge <zeratul976@xxxxxxxxxxx>
Reviewed-on: <a href="https://git.eclipse.org/r/14764">https://git.eclipse.org/r/14764</a>
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
Tested-by: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=bb84b5cba3e1948297c22ed4f327a2e74973c6da
Fixed in 8.2.1 and master. Verified in 8.2.1 RC1 (EPP 20130821-2252). |