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: [commit] Do not rely on FIELD_LOC_KIND_BITPOS being zero


On Tue, 17 Apr 2012 15:57:11 +0200, Pedro Alves wrote:
> -	      FIELD_BITPOS (*fp) += DW_UNSND (attr);
> +	      SET_FIELD_BITPOS (*fp, FIELD_BITPOS (*fp) + DW_UNSND (attr));

I do not like this apprach as it misleads the reader that FIELD_BITPOS is
newly set here.  This is why I did not want to implement such change and just
fixed the existing cases.

FIELD_BITPOS is being only added to, which the original code said.  Now the
code is not so clear.

I understand it was coded to prevent new code using
	FIELD_BITPOS (*fp) = newval;
but I guess it can happen again but now the contributor will just use:
	FIELD_BITPOS_LVAL (*fp) = newval;

That it gets caught by review is true but particularly with GDB many patches
are even never submitted.


Regards,
Jan


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