From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9803 invoked by alias); 9 Jan 2008 15:02:42 -0000 Received: (qmail 9793 invoked by uid 22791); 9 Jan 2008 15:02:41 -0000 X-Spam-Check-By: sourceware.org Received: from smtp2-v.fe.bosch.de (HELO smtp2-v.fe.bosch.de) (139.15.237.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 09 Jan 2008 15:02:09 +0000 Received: from vsmta1.fe.internet.bosch.com (unknown [10.4.98.30]) by imta6.fe.bosch.de (Postfix) with ESMTP id 7F82938042 for ; Wed, 9 Jan 2008 16:02:05 +0100 (CET) Received: from si-imc02.de.bosch.com (vsgw2.fe.internet.bosch.com [10.4.98.13]) by vsmta1.fe.internet.bosch.com (Postfix) with ESMTP id 718D5F98003 for ; Wed, 9 Jan 2008 16:02:05 +0100 (CET) Received: from si-mail07.de.bosch.com ([10.3.2.166]) by si-imc02.de.bosch.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Jan 2008 16:02:05 +0100 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 09 Jan 2008 15:02:00 -0000 Message-ID: In-Reply-To: References: From: "EXTERNAL Gladis Olaf (Praktikant; CR/AEM)" To: , "ecos-discuss" 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] pragma pack X-SW-Source: 2008-01/txt/msg00030.txt.bz2 Sorry forget to reply to all: Hi Alex, I am not 100% sure but i think you have to write it like this: #pragma pack(push,1) typedef struct { cyg_uint8 command2_byte; cyg_uint8 data3; cyg_uint8 data4; cyg_uint16 timestamp; } pelco_pattern; #pragma pack(pop) You have to add push and pop in you code. So try this and write if this is helping you. Greets Olaf Gladis=20 -----Original Message----- From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Alexandre Sent: Mittwoch, 9. Januar 2008 15:19 To: ecos-discuss Subject: [ECOS] pragma pack Hi everybody (and happy new year would i add), I'd like to use the pragma pack(1) in one of my applications to align properly a 5 bytes structures array into flash. I know that packing reduces greatly the performances of the system but performance is not really my problem here as i'm actually looking for more memory and would greatly need to pack things up a little bit. I tried to declare the next structure as shown, with the pragmas, but it's still 8 bytes large, either read with a sizeof(pelco_pattern) or after being written in rom: #pragma pack(1) typedef struct { cyg_uint8 command2_byte; cyg_uint8 data3; cyg_uint8 data4; cyg_uint16 timestamp; } pelco_pattern; #pragma pack() Am I doing something wrong here ? Is it even possible to use "pack"'s pragmas within ecos ? Am I missing some compiler directives ? I am using the arm-elf-gcc compiler and the lpc2xxx / arm version of ecos. The compiler does not say anything about the line with the pragma in it. Thanks in advance for you answers ^^ Alex Garcia Hymatom SA --=20 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