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 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


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