This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/8] [PowerPC] Consolidate linux target description selection
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedromfc at linux dot vnet dot ibm dot com (Pedro Franco de Carvalho)
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 17 May 2018 10:15:33 +0200 (CEST)
- Subject: Re: [PATCH 1/8] [PowerPC] Consolidate linux target description selection
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