From: <no...@so...> - 2001-10-04 14:47:06
|
Bugs item #467893, was opened at 2001-10-04 07:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=467893&group_id=599 Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SDCC and structures Initial Comment: In the discussion forum on 2000-11-16 05:19, Carl van Schaik mentioned that "It seens SDCC can't support arrays inside of structures..." I've downloaded SDCC 2.3.0 and the problem that Carl mentioned still exists. Here is an example: struct structure { short array[8]; } s; void function( void ) { short i; short *p; for( i=0; i<8; i++ ) s.array[i] = 0; //test.c(11):warning *** indirections to different types assignment //type --> 'char ' assigned to type --> 'unknown type ' *(s.array + i) = 0; //test.c(15):error *** Pointer required i += s.array[5]; //test.c(18):error *** invalid operand '+' p = s.array; for( i=0; i<8; i++ ) p[i] = 0; //workaround? } These errors only come up when "array" is short or long. I don't get any errors when "array" is char. This code compiles on other C compilers. Geoffrey ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=467893&group_id=599 |