This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Merge GCC producer parsers. Allow digits in identifiers.


On Thu, 2015-01-29 at 12:00 +0400, Joel Brobecker wrote:
> Looking at the function, it seems to me that the current design of
> the function is a little strange: Named "producer_is_gcc", it'd expect
> the return value to be a boolean. So, if the function returned that
> and had an extra parameter for getting the major, the issue would
> not arise:
> 
>         else if (producer_is_gcc (cu->producer, &major, &minor))
> 
> I think you chose this approach out of consistency with
> producer_is_gcc_ge_4, which is why I'm OK with the current patch.
> But if I were to look into this, what I would do replace the two
> calls to this function with calls to your new function.
> 
> I might also allow major/minor to be NULL to spare users the need
> to create variables that they will not need afterwards.
> 
> So, to sumarize, push as is, and then let's clean this up (you don't
> have to do the cleanup, if you don't want to, but let me know if you
> pass, as I'd like to take over if you do).

Thanks, I pushed as is. You observations are correct.
I'll refactor this as you suggest in a separate patch.


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