From: Fokkema DOT DBRA AT delorie DOT com, 1043730 Newsgroups: comp.os.msdos.djgpp Subject: Re: struct problem Date: Fri, 22 Oct 1999 07:25:38 GMT Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Message-ID: <7up3hi$nk7@cs.vu.nl> References: <7umn1a$q3o AT cs DOT vu DOT nl> <380F206B DOT 8AE AT erols DOT com> NNTP-Posting-Host: galjas.cs.vu.nl X-Newsreader: TIN [version 1.2 PL2] X-Poster-Key: sha1:Kdd2ibmlSLPqDwerJdiutW622qM= Cancel-Lock: sha1:9m6kLJf2nK42RsmE0uvncxDJaBo= Lines: 37 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com John S. Fine (johnfine AT erols DOT com) wrote: : I couldn't follow most of what you said, and the 'ed parts : of your code contain the parts that are the problem, so I can't : give you an exact answer. Sorry for that. : You may know that the entire value fits in 24-bits (maybe even : 16) but there is no way for the compiler to communicate that to : the linker in COFF format. Ah, I see. Never suspected that that could be the problem. Now I see why an other pointer (to a function) I used did work: it fitted nicely in a 32bits variable. : One kludge I used before I wrote that linker was to have a version : of the descriptor structure in which the middle dword is defined : as a single value. (Make sure you use __attribute__((packed)) so : that a long can be placed at offset 2 in a struct). I then init : it with address+(attributes<<24). Since attributes is a compile : time constant, it is no problem; And since the field is a long, : COFF format handles not knowing the address until link time. (You : still need to make sure the address fits in 24-bits.) Thanks! It works, now. : BTW, the descriptor needs a linear address. The linker will give : you an offset. If there is a difference between those, you must : handle that as well. Had that handled, already. Thank you very much for your help. Sometimes I just don't know what these djgpp error messages are about. Anyway, it works fine now. David