This is the mail archive of the gdb-patches@sources.redhat.com 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: RFA: ``set mips abi''


If we didn't already have and need the enum all over that file, I'd
agree with you.  I don't see a point in all the extra globals.  But
hey, I don't mind.
Yes, I noticed that. I was thinking of just changing the global_...() function to be:

if (mips_abi == mips_abi_o32)
return MIPS_ABI_O32;
else if (...)
..
else
internal error()

so that the rest didn't need to be changed. It is how it has been done in the past.


(Having an enum mechanism that bound a number to a name would be nice).

You can do it very easily with designated initializers, but they are
not adequately portable.  You can do it very easily building the array
at runtime but why bother?  Keeping two lists in sync is not the most
complicated thing in the world.
(what's a designated initializer?)

True, if there is a way to do it reliably though.

Andrew



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