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: [RFC 1/8] Language independent bits


On Sunday, January 15 2012, Jan Kratochvil wrote:

> On Sun, 15 Jan 2012 22:07:30 +0100, Sergio Durigan Junior wrote:
>> >> +  ps->expout = (struct expression *)
>> >> +    xmalloc (sizeof (struct expression)
>> >> +    + EXP_ELEM_TO_BYTES (ps->expout_size));
>> >
>> > That return type cast is excessive.  It had meaning for K&R C where xmalloc
>> > returns PTR but that is no longer supported.  There should be done
>> > s/PTR/void */ everywhere and #define PTR should be removed
>> > and #pragma GCC poison -ed.
>> 
>> Sorry, I am not sure I understood your argument.
>
> I do not understand why you put that cast in.

I didn't.  This code already existed, and I just copied and pasted it.
When I did that, I must confess that I did not notice the casting to
struct expression, so thanks for catching it.


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