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


Daniel Jacobowitz <drow@mvista.com> writes:

|> > >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?)
|> 
|> I think I'm mixing terms here; I'm thinking of two language extensions
|> in GCC and c99.  The pertinent one is:

The term is correct, but the C99 syntax is different.

|> void *array[] = {
|>   [1] NULL,
|>   [2] some_void_ptr,
|>   [3] NULL,
|> };

void *array[] = {
  [1] = NULL,
  [2] = some_void_ptr,
  [3] = NULL,
};

|> I think you can use enum values as the tags but I'm not quite sure.

You can use any constant expression in an array designator.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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