[cfe-dev] Proposal: Add diagnostic enumeration to libclang
David Blaikie
dblaikie at gmail.com
Thu Jan 5 00:11:51 PST 2012
The rules are there to protect -fixit behavior - a fixit hint on an
error or warning cannot change the semantics of the program (imho,
though it'd be substantially more expensive to implement - it probably
should even produce identical ASTs, in fact, to be sure of exact error
recovery. Of course that's harder for warnings since they'd have to
conditionally modify the AST only if the warning was currently an
error) because they may be automatically applied by clang -fixit.
So the only fixit a warning should have is the fixit necessary to
suppress the warning without changing the program's behavior. Any
fixits that might address a mistake made by the user must be presented
in notes.
- David
On Thu, Jan 5, 2012 at 12:02 AM, James Molloy <james.molloy at arm.com> wrote:
> I agree - just because there is one *obvious* correction does not mean that
> it is the correct correction or what the user intended.
>
> -----Original Message-----
> From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On
> Behalf Of Dave Abrahams
> Sent: 05 January 2012 02:03
> To: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] Proposal: Add diagnostic enumeration to libclang
>
>
> on Wed Jan 04 2012, Matthieu Monrocq
> <matthieu.monrocq-Re5JQEeQqe8AvxtiuMwx3w-AT-public.gmane.org> wrote:
>
>> Indeed one of the driving philosophy is that Clang should only provide
>> Fix Hints when there is a single possible correction, lest it broke
>> the code further.
>
> But that's technically impossible; there's never a single possible
> correction.
>
> --
> Dave Abrahams
> BoostPro Computing
> http://www.boostpro.com
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list