> On Oct 2, 2017, at 4:05 PM, David Malcolm <dmalc...@redhat.com> wrote:
> 
> ...
> the C FE currently emits (trunk):
> 
>  test.c: In function 'caller':
>  test.c:5:25: warning: passing argument 2 of 'callee' makes pointer from
>  integer without a cast [-Wint-conversion]
>     return callee (first, second, third);
>                           ^~~~~~
>  test.c:1:12: note: expected 'const char *' but argument is of type 'int'
>   extern int callee (int one, const char *two, float three);
>              ^~~~~~
> 
> whereas with this patch the note underlines the pertinent param of
> the callee:
> 
>  test.c: In function 'caller':
>  test.c:5:25: warning: passing argument 2 of 'callee' makes pointer from
>  integer without a cast [-Wint-conversion]
>     return callee (first, second, third);
>                           ^~~~~~
>  test.c:1:41: note: expected 'const char *' but argument is of type 'int'
>   extern int callee (int one, const char *two, float three);
>                               ~~~~~~~~~~~~^~~
> 
> making the problem more obvious to the user.

I'm not sure why you'd point at the formal parameter name, which isn't 
significant and might not be present.  The issue is with the type, so pointing 
at the type ("const char *") would seem more obvious.

        paul

Reply via email to