This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Array of Structures Initialization
- From: Kevin Stedman <kstedman9 at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 15 Nov 2004 06:21:57 -0800 (PST)
- Subject: Array of Structures Initialization
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=EqldOKMn3HZaPwL2/xbfWPyWY+ygZilSFXZcRY/2jDuYBTnsSzP5va77ArT0oBI6xLNk9Jle42wPrTwENvgMD4EmJfaniy4YZBvat15BEwwOl4ztvAe8SQ+Enbllw11pqkUHbdmRQ8rK4lRd45f/LCGihLyB0E9a9MqGS3IwGWU= ;
Hello All,
Can someone give me an idea on how to figure out what
is going on with my initialization of an array of
structures. This code compiles on Sun using the Sun
One studio CC compiler. I am porting it to lnux and
have never seen this problem before. Code examples of
what I am trying to compile are below. Everything is
in the C header file. When I compile I do not have
any gcc flags except for -g -c -o. I get error
messages: "initializer element is not constant" and
"incompatible types in initialization" on every line
of the initialization of the array of structures
below.
#define INTEGER4 4
#define REAL8 8
#define STRING 9
typedef union{
double RealX8;
long IntX4;
char *Str;
} InputValue;
typedef struct _Arguments{
int keyword;
char *prompt_string;
char *default_string;
int type;
InputValue default_value;
} Arguments;
Arguments SortLightningArgs[]={
{Title, "NLDN Sort Routine (US
only)",NULL,INTEGER4,NULL},
{UserDefined,"Minimum propagation
delay",".001",REAL8,NULL},
{UserDefined,"Maximum propagation
delay","1.0",REAL8,NULL},
{UserDefined,"Minimum latitude","20.0", REAL8,NULL},
{UserDefined,"Maximum latitude","50.0", REAL8,NULL},
{UserDefined,"Minimum longitude","-50.0",
REAL8,NULL},
{UserDefined,"Maximum longitude","-150.0",
REAL8,NULL},
{UserDefined,"Input file containing NLDN event
times","lightning.times.251_253", STRING,NULL},
{UserDefined,"Output file containing list of time
differences and intensities",
"HistoTimeDifs.txt", STRING,NULL},
{NULL,NULL,NULL,NULL,NULL}
};
Thank You for any help,
Kevin
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com