This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: i960 and structures


Hi Stephane!

thank you for the reply,
On Thu, May 04, 2000 at 01:52:07PM -0400, Stephane Dalton wrote:
> > The pc side of these structures has the size and alignment, which i want,
> > specifying some "pragma pack" or some "attributes". But the i960 side
> > _always_ alligns on 16 byte boundarys.
> 	You can probably get around this problem using the __attribute__ of
thats that i was talking about, when i wrote "some attributes"
but a have now again searched deja, and i found the solution. just for the
records (and if someone has such a problem):

given a structure like:
typedef struct _CardConfig {
  unsigned char ucaIDString[5];
  unsigned char ucVersionCard;
  unsigned char ucVersionProgramm;
  unsigned char ucSubVersionProgramm;
  unsigned char ucRevisionProgramm;
  unsigned char ucPortsFound;
  unsigned char ucDebugLevel;
} CardConfig;

you will have 5 bytes at the end of this structure.
defining it as
[...]
} CardConfig __attribute__ ((packed));
(as i have done) will not help here.
the structure must be defined as:
} __attribute__((packed)) CardConfig;

thats all.
and therefore a had to strugle almost a week...

> gcc you'll more informations in the gcc manual by typing info gcc
not realy :-|
a little bit offtopic, but:
do you know how i can get the "dir" file in the info directory back,
when i was so crazy do delete it?
system is debian 2.3 (woody) gnu/linux

-- 
Helmut Kolb                              KNAPP Logistik & Automation G.m.b.H.
Kolb.Helmut@knapp.co.at     Guenter-Knapp-Str. 5-7 A-8075 Hart/Graz, Austria
Oxymoron: Military Intelligence

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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