From mint-bounce@lists.fishpool.fi Wed May 26 08:47:25 2010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=RHgcqA16lUFIeyQj32PaeOSPs7FTQLaam1VVRX3QRIk=; b=XdCWgNiofNy5gc8sbif0qPUxgE+zMJ1Hhu7x0GCQH/iTuRAtIMX+G/PLAdq+zjES/G Yh+FapvWZPbPVd4/rFQLro12kOB/AgxPV60EeIjZLRAV7fghZgsqDLOkB6KEhcQjKdIk ExHUGBSQ/e3Q9rRpX5ivxOdv2v8FUd/lNN918= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Rxzzw3NcHFrytUEdiVzeg2NiMOeLbst9JJ3a1gTLa49LLg8Hiv3R1A7QRR5c4UUE7b cRnLDFK7H/xTGXoUpHCApgykpRCP60Yh/LUm1zjPpRCSSK8Qyrt9IfvkakcVZ/NEVozT LAlMVGZLX/lHXPqJhgexPhAlAKMk8uMO3/Xa8= Message-ID: <4BFD17E1.8080708@freesbee.fr> Date: Wed, 26 May 2010 14:45:21 +0200 From: =?UTF-8?B?VmluY2VudCBSaXZpw6hyZQ==?= User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] How serious is GCC "cast increases requiered alignment of target type" warning? References: <4BFCEFF8.7030106@freesbee.fr> <0003d272.019a6e9ea6a8@smtp.freeola.net> <3979b328d2ec700d36fa822a1a925845-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYOWUF3CVI6XF1YRU0FW1xdQw==-webmailer2@server07.webmailer.hosteurope.de> <4BFD0C64.30207@freesbee.fr> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: m0n0 wrote: > m68k-atari-mint-gcc -c testm.c -Wall -Wcast-align You didn't mention that -Wcast-align option ! This is why I never saw your warning, because it is disabled by default. > return (uint32_t *)(nsfb->ptr + (y * nsfb->linelen) + (x << 2)); I can't compile right now, but now I understand. If nsfb->ptr is aligned on 4 and nsfb->linelen is a multiple of 4, the result will always be aligned, since (x << 2) is always a multiple of 4. However, the compiler can't be sure about that so it generates a warning. So in this case, if the requirements are met, the returned pointer will always be valid, and the warning can safely be ignored. -- Vincent Rivière