This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] cleanups in line-map
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Tom Tromey <tom at tromey dot com>
- Date: Mon, 13 Oct 2014 11:06:09 +0200
- Subject: Re: [PATCH] cleanups in line-map
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQDatbjs7nihn=hzYByAMQHzRRepiOSBLum3OAv2Qfy0DA at mail dot gmail dot com> <87k344wduh dot fsf at redhat dot com>
On 13 October 2014 10:52, Dodji Seketeli <email@example.com> wrote:
> Manuel López-Ibáñez <firstname.lastname@example.org> writes:
>> Index: libcpp/line-map.c
>> --- libcpp/line-map.c (revision 216098)
>> +++ libcpp/line-map.c (working copy)
>> @@ -29,12 +29,10 @@ along with this program; see the file CO
>> static void trace_include (const struct line_maps *, const struct line_map *);
>> static const struct line_map * linemap_ordinary_map_lookup (struct line_maps *,
>> static const struct line_map* linemap_macro_map_lookup (struct line_maps *,
>> -static source_location linemap_macro_map_loc_to_def_point
>> -(const struct line_map*, source_location);
> This is not redundant per se, is it? It's just a forward declaration of
> the function that is defined later. Just like for
> linemap_macro_map_loc_unwind_toward_spelling() below. Or what am I
> missing? I'd prefer to see this forward declaration stay, FWIW.
Oh, well, I guess it is a matter of taste. I was annoyed by having to
update two different places (I added "const" to the first argument of
this definition function, so I will have to also add it here).
Moreover, as the patch shows, the two declarations might be different
(one was static, the other not), and then which one is the "correct
one" requires some expert knowledge of C++. I understand using forward
declarations when otherwise it would be a mess to re-order the
functions, but in this case, it is not really necessary. But I can
leave it and just update the argument type.
> Otherwise, this cleanup patch looks good to me. If it was my call, I'd
> say "OK with that change".
> Thank you for tackling this.
Thanks for the review.