[PATCH 1/8] [PowerPC] Consolidate linux target description selection
Ulrich Weigand
uweigand@de.ibm.com
Thu May 17 08:28:00 GMT 2018
Pedro Franco de Carvalho wrote.
> Ulrich Weigand <uweigand@de.ibm.com> writes:
>
> >> +/* Base value for ppc_linux_features variables. */
> >> +const struct ppc_linux_features ppc_linux_no_features = {
> >> + 4,
> >> + false,
> >> + false,
> >> + false,
> >> + false,
> >> +};
> >
> > I'm not sure it makes much sense to declare "4" the default wordsize
> > -- there's not really a default between 4 and 8. Maybe it would be
> > clearer to just force all users to explicitly set the wordsize.
>
> Is something like this a good style, or should I just initialize
> wordsize to 0 and let the previous assert in ppc_match_description
> ensure that the wordsize is either 4 or 8?
If the members are all public anyway, I'm not sure it buys us much
to set wordsize in the constructor ... I'd just let the user set it
and then verify via an assert, as you suggest.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
More information about the Gdb-patches
mailing list