[RFA] Emit a warning for ineffective set VAR = EXP command
Paul_Koning@Dell.com
Paul_Koning@Dell.com
Wed May 9 15:55:00 GMT 2012
On May 9, 2012, at 11:38 AM, Maciej W. Rozycki wrote:
> On Wed, 9 May 2012, Paul_Koning@Dell.com wrote:
>
>>> What do you mean by "work" here? I think a warning for "i++ * 2" is
>>> expected as that's questionable use -- the result of the multiplication is
>>> discarded. Did you mean anything else?
>>
>> You're right, but it does perform an assignment (to "i") so a message
>> saying that the statement has no effect is not accurate. Then again,
>> given that the statement doesn't make much sense, the fact that the
>> message is not completely accurate isn't all that interesting -- unlike
>> the simple "i++" it isn't a likely case in reality.
>
> I think it's all right -- "might have no effect" is weaker than "has no
> effect" and will draw one's attention in the case of a typo or suchlike.
>
> Maciej
Good point. So I'll agree that the proposed change is fine (and no, I can't approve it either).
paul
More information about the Gdb-patches
mailing list