This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help! Regarding Bug 17896

On Mon, 2016-01-25 at 21:54 +0000, Manuel LÃpez-IbÃÃez wrote:
> On 25 January 2016 at 20:17, Mikhail Maltsev <> wrote:
> > As I understand, the bug report suggests that we say "suggest || instead of |
> > when joining booleans" instead. We now have the API to show fix-it hints, so it
> > would be nice to output something like
> >
> > test.c:17:21: warning: suggest || instead of | when joining booleans
> >    foo ((a == b) | b == c);
> >                  ^
> >                  ||
> >
> > Grep 'set_fixit_hint' in the source code to see an example of it's usage.
> I think you should focus on one single very simple thing for a first
> patch, either adding fix-it hints to the existing warning or adding
> the alternative text. I would in fact suggest to add fix-it hints
> without touching anything else, since this is probably less
> controversial [*] and more straightforward. How?
> 1) Grep 'set_fixit_hint' in gcc/* gcc/cp/* gcc/c/* gcc/c-family/* and
> see how it is used.
I agree with Manu's advice, though as it happens, grepping for
"set_fixit_hint" will show you the *implementation* of fixit hints,
whereas Manu is suggesting you look at *users* of fixit hints.

You could grep for "add_fixit", instead, though currently we only have
one usage in the tree.  You might also want to look at these patches:
(these ones missed the feature freeze for gcc 6).

Hope this is helpful; good luck!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]