From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12005 invoked by alias); 19 Dec 2009 17:00:20 -0000 Received: (qmail 11997 invoked by uid 22791); 19 Dec 2009 17:00:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail2.rz.htw-berlin.de (HELO mail2.rz.htw-berlin.de) (141.45.10.102) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Dec 2009 17:00:15 +0000 Envelope-to: gcc-help@gcc.gnu.org Received: from e178096135.adsl.alicedsl.de ([85.178.96.135] helo=[192.168.178.20]) by mail2.rz.htw-berlin.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1NM2f6-0002qt-Ol for gcc-help@gcc.gnu.org; Sat, 19 Dec 2009 18:00:12 +0100 Message-ID: <4B2D069D.9080100@htw-berlin.de> Date: Sat, 19 Dec 2009 17:09:00 -0000 From: Thomas Martitz Reply-To: thomas.martitz@student.htw-berlin.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b1pre Thunderbird/3.0 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: Need help using gcc in command line mode. References: <1261236913_110979@mail01> In-Reply-To: <1261236913_110979@mail01> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HTW-SPAMINFO: this message was scanned by eXpurgate (http://www.eleven.de) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00288.txt.bz2 Am 19.12.2009 16:35, schrieb Gene Creighton: > > typedef struct > { > short ImageFileType; > long FileSize; > short Reserved1; > short Reserved2; > long ImageDataOffset; > } WIN3XHEAD; > > typedef struct > { > long HeaderSize; > long ImageWidth; > long ImageHeight; > short NumberOfImagePlanes; > short BitsPerPixel; > long CompressionMethod; > long SizeOfBitmap; > long HorzResolution; > long VertResolution; > long NumColorsUsed; > long NumSignificantColors; > } WIN3XINFOHEAD; > > > ---------- > Try appending __attribute__((packed)) after the closing } of the structs in question. That should disable padding. Furthermore I recommend using int32_t instead of long, since long is 8 bytes on 64-bit Linux systems (hence your code wouldn't work on those). Best regards.