🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13841

Re: alignment

#13841
From: Bob Gonder
Date: Wed, 17 Sep 2003 17:46
24 lines
2139 bytes
Antonio Farfan wrote:

>Now I solve the problem with the option of compiler of Bytes (Alignment) but
>i have to add fields of padding in the struct. This is my problem. This
>procedure is not very graceful. If there are any change in the Struct i need
>to readjust the paddings.You can read my first email.

There are 53 bytes before your problem sub-structure.
If you need 1 byte of padding, then you need WORD alignment.
If you need 3, then you need DWORD alignment

TSettings is 17 bytes, so it is going to throw off the alignment for
alarmRecord also (unless you need WORD alignment).
Since you haven't mentioned alarmRecord being incorrect, you probably
need WORD alignment.
Either
#pragma option -a2
or
#pragma   pack(push,2)


If you still can't get it to work,
Repost just the one structure definition TPS_Settings;
Show us the "padding" that makes it "work" with byte alignment.
Technical Details
Message-ID: <kb6hmv0pa8o95ursa78l00hjlem1ghsu8q@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f673746@newsgroups.borland.com> <3f674494$1@newsgroups.borland.com> <3f6749b2$1@newsgroups.borland.com> <3f676a91@newsgroups.borland.com> <3f688407@newsgroups.borland.com> <3F688926.EF20C0EF@sbcglobal.net> <3f688cb6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a9334a47483d8c0e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-17 11:10:54 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: alignment
Date: Wed, 17 Sep 2003 10:46:22 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <kb6hmv0pa8o95ursa78l00hjlem1ghsu8q@4ax.com>
References: <3f673746@newsgroups.borland.com> <3f674494$1@newsgroups.borland.com> <3f6749b2$1@newsgroups.borland.com> <3f676a91@newsgroups.borland.com> <3f688407@newsgroups.borland.com> <3F688926.EF20C0EF@sbcglobal.net> <3f688cb6$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.34
X-Trace: newsgroups.borland.com 1063820780 67.31.164.34 (17 Sep 2003 10:46:20 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail