Article View: borland.public.cppbuilder.nativeapi
Article #15611Re: Structure and sizeof mis-behaving
From: Alan Bellingham
Date: Sun, 22 Jun 2003 22:48
Date: Sun, 22 Jun 2003 22:48
51 lines
2562 bytes
2562 bytes
Bob Gonder <notbg@notmindspring.invalid> wrote:
>In other words, this is essentially what the code says:
>
>#if ! defined(lint)
> #if ! defined(RC_INVOKED)
> #pragma pack(2)
> #endif
>#endif
>typedef struct{
>};
>#if ! defined(lint)
> #if ! defined(RC_INVOKED)
> #pragma pack()
> #endif
>#endif
Or, more concisely:
#if !(defined(lint) || defined(RC_INVOKED))
#pragma pack(2)
#endif
typedef struct{
};
#if !(defined(lint) || defined(RC_INVOKED))
#pragma pack()
#endif
>So, you want to turn Off lint to get the smaller structures.
>I don't know why they don't want to pack for lint.
lint doesn't care about structure packing - it's a code checker, not a
code compiler. Therefore, it makes sense to tell it not to include files
that it doesn't need, and that just cause extra warnings to be produced.
(Unknown pragma, for one, and, probably warnings about multiple
inclusion of the push/pop headers.)
If you've got 'lint' defined for compiling, you've got a seriously
confused setup.
>I assume RC_INVOKED means the Resource Compiler.
Usually. Again, packing is irrelevant, and anyway, the resource compiler
doesn't understand all C++, so why confuse it.
Alan Bellingham
--
Me <url:mailto:alanb@episys.com> <url:http://www.doughnut.demon.co.uk/>
ACCU - C, C++ and Java programming <url:http://accu.org/>
The 2004 Discworld Convention <url:http://dwcon.org/>
Technical Details
Message-ID:
<i5ccfv8ihu9te3o1j2if76it2gv4h5tl0f@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3eed33f3$1@newsgroups.borland.com> <3eeda998@newsgroups.borland.com> <obtsev8l77n8ugm19f19vv5577gnm6mqs2@4ax.com> <3ef600c0$1@newsgroups.borland.com> <l6acfv45i8a0qtl1jitlt1bvdahca8siva@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,316b0e1c5551c37a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-22 15:56:19 PST From: Alan Bellingham <alanb@episys.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Structure and sizeof mis-behaving Date: Sun, 22 Jun 2003 23:48:24 +0100 Reply-To: alanb@episys.com Message-ID: <i5ccfv8ihu9te3o1j2if76it2gv4h5tl0f@4ax.com> References: <3eed33f3$1@newsgroups.borland.com> <3eeda998@newsgroups.borland.com> <obtsev8l77n8ugm19f19vv5577gnm6mqs2@4ax.com> <3ef600c0$1@newsgroups.borland.com> <l6acfv45i8a0qtl1jitlt1bvdahca8siva@4ax.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.49.31.105 X-Trace: newsgroups.borland.com 1056322103 62.49.31.105 (22 Jun 2003 15:48:23 -0700) Lines: 51 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail