Re: [PATCH] C: underline parameters in mismatching function calls

2017-10-03 Thread Joseph Myers
On Mon, 2 Oct 2017, David Malcolm wrote: > gcc/c/ChangeLog: > * c-decl.c (push_parm_decl): Store c_parm's location into the > PARAM_DECL. > (build_c_parm): Add "loc" param and store it within the c_parm. > * c-parser.c (struct c_parser): Add "last_token_location" field. >

Re: [PATCH] C: underline parameters in mismatching function calls

2017-10-02 Thread David Malcolm
On Mon, 2017-10-02 at 16:22 -0400, Paul Koning wrote: > > On Oct 2, 2017, at 4:05 PM, David Malcolm > > wrote: > > > > ... > > the C FE currently emits (trunk): > > > > test.c: In function 'caller': > > test.c:5:25: warning: passing argument 2 of 'callee' makes pointer >

Re: [PATCH] C: underline parameters in mismatching function calls

2017-10-02 Thread Paul Koning
> On Oct 2, 2017, at 4:05 PM, David Malcolm 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

[PATCH] C: underline parameters in mismatching function calls

2017-10-02 Thread David Malcolm
In r253096 ("C++: underline parameters in mismatching function calls" aka 5d78d423a5f7a1d135c7bb678e82007678d1313c https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01546.html ) I updated the C++ FE's handling of mismatched types in function calls so that it underlines the pertinent param of

Re: [PATCH] C++: underline parameters in mismatching function calls

2017-09-21 Thread Martin Sebor
On 09/20/2017 01:52 PM, David Malcolm wrote: When we have a type mismatch in a C++ function call, e.g. extern int callee (int one, const char *two, float three); int caller (int first, int second, float third) { return callee (first, second, third); } we currently emit something

Re: [PATCH] C++: underline parameters in mismatching function calls

2017-09-21 Thread Jason Merrill
On Wed, Sep 20, 2017 at 3:52 PM, David Malcolm wrote: > + /* If we have a method, then DECL_ARGUMENTS begins with "this"; > + increment ARGNUM to skip it. */ > + if (TREE_CODE (TREE_TYPE (fndecl)) == METHOD_TYPE) > +argnum++; > + > + /* Locate param by index

Re: [PATCH] C++: underline parameters in mismatching function calls

2017-09-21 Thread Nathan Sidwell
On 09/20/2017 12:52 PM, David Malcolm wrote: When we have a type mismatch in a C++ function call, e.g. whereas underlining the mismatching things would make the messages easier to comprehend: test.c: In function 'int caller(int, int, float)': test.c:5:38: error: invalid conversion from

[PATCH] C++: underline parameters in mismatching function calls

2017-09-20 Thread David Malcolm
When we have a type mismatch in a C++ function call, e.g. extern int callee (int one, const char *two, float three); int caller (int first, int second, float third) { return callee (first, second, third); } we currently emit something like this: test.c: In function 'int