home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!usc!rpi!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!mahmad
- From: mahmad@acs.ucalgary.ca (Mohamed Ahmad)
- Subject: 16 bit alignment of struct members in GCC 2.1
- Sender: news@acs.ucalgary.ca (USENET News System)
- Message-ID: <92Aug29.164209.14207@acs.ucalgary.ca>
- Date: Sat, 29 Aug 92 16:42:09 GMT
- Nntp-Posting-Host: acs2.acs.ucalgary.ca
- Organization: The University of Calgary, Alberta
- Lines: 12
-
-
- I have the file format for a DOS-based brain scanning
- machine in the form of a C structure. Being of DOS (and hence 16
- bit) orgin, the struct members are 16-bit aligned. I wish to
- read some files of this format under OS/2 2.0. Unfortunately,
- when I compile the program using GCC 2.1, some variables
- (especially floats) are 32-bit aligned and so the struct no
- longer corresponds to the file format. I have tried using GCC's
- ___attribute___(aligned((2))) statement to force 16-bit alignment
- but have had no success. Any ideas? Thanks in advance for any help.
-
- Mohamed Ahmad
-