From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4745 invoked by alias); 10 Jan 2008 09:43:18 -0000 Received: (qmail 4732 invoked by uid 22791); 10 Jan 2008 09:43:17 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.183) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 09:42:42 +0000 Received: by wa-out-1112.google.com with SMTP id l24so1068412waf.22 for ; Thu, 10 Jan 2008 01:42:41 -0800 (PST) Received: by 10.114.52.1 with SMTP id z1mr2025348waz.123.1199958161051; Thu, 10 Jan 2008 01:42:41 -0800 (PST) Received: by 10.115.109.11 with HTTP; Thu, 10 Jan 2008 01:42:40 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 09:43:00 -0000 From: Alexandre Reply-To: thekyz@gmail.com To: "Paul D. DeRocco" Cc: ecos-discuss@ecos.sourceware.org In-Reply-To: <015801c85322$bf2055e0$887ba8c0@PAULD> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <015801c85322$bf2055e0$887ba8c0@PAULD> X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: pragma pack X-SW-Source: 2008-01/txt/msg00038.txt.bz2 Actually i had some problems accessing my packed structures without flows, I think that may help resolve things a bit. Eg with things like that: cyg_uint8 i = 0; struct s_pelco_pattern_array a; a.command2_byte = i++; a.data3 = i++; a.data4 = i++; a.timestamp = i; I finish having a structure which looks like this in memory: cm2: 0x00 data3: 0x01 data4: 0x02 ts: 0x0300 Which is really not what i want to have eventually. On Jan 10, 2008 1:50 AM, Paul D. DeRocco wrote: > > From: Grant Edwards > > > > The trap snaps shut when you take the address of a field in a > > packed struct and pass that to somebody who's expecting a > > pointer to a normally aligned value. > > True. I could imagine ways in which the type system could be designed to > prevent that, using a pointer modifier like "int __packed*", but it's not. > > Anyway, for normal accesses, it works fine, so you can do things like > operate on the fields in a DOS boot sector without problems. That's the only > situation I've ever needed the feature. > > -- > > Ciao, Paul D. DeRocco > Paul mailto:pderocco@ix.netcom.com > > > -- > > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss