[cfe-dev] Fixit order
Jordy Rose
jediknil at belkadan.com
Tue Jun 21 12:38:04 PDT 2011
On Jun 21, 2011, at 12:09, Argyrios Kyrtzidis wrote:
> On Jun 21, 2011, at 11:45 AM, Chandler Carruth wrote:
>
>> After discussing this on IRC with dgregor, he agreed and raised another perspective that I find compelling for inverting the current policy: if there is a fixit suggestion note which merely silences the compiler, it should be *last*.
>>
>> < dgregor> I do agree that always putting "silence the compiler" last would be better… essentially, one could imagine the user reading each of the notes, shaking his head, and then clicking on the last one "oh, shut up, I know what I'm doing"
>
> I'd personally would like the one that was more likely what I intended to be first.
I agree in theory, but I think that determining "what's most likely" is more nebulous than "silence the warning without changing semantics". I don't particularly mind whether "silence" comes first or last, but I think it's more important to have a convention for that than it is to get the /first/ fixit to be the most useful.
The way I personally see fixits as "the standard assumes you meant this, but maybe you meant this". Seen that way it makes sense to put the "silence" option first. On the other hand, if an ambiguous expression gets flagged, maybe it's a good thing if the compiler makes me think about what I meant, which would support putting the "silence" option at the end.
Jordy
More information about the cfe-dev
mailing list