From mint-bounce@lists.fishpool.fi Sun May 24 17:51:10 2009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=2Fcb7JVsPvWnsTmBBNblG7kL7mq8Ujbi8aiVhBESxCU=; b=JsK243OA4XXIGnqNNqSZBbSVd32jxCR2q8LBznLyi9gaVGOEw4s6hzcn1YAseSonvL tCEpBdKF6jUqZpPQNjwX3mJHL4MGXUPOGfr0UNgkIXj/c0+vZRCZyevqJssHyukJpbg5 wNqTszIzgIh81mW9iBivJqGv9+EO5vJ5qqGUU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=saAxhoFHTY/lHysShovONsGj0Lmm7zMP/cvACxb2/sVTT9Ondz5HR4tN1cFG0gvQs+ eV09JpuBk7EglM6DVI0PWAAHeAp2C7DDGhprBKGPZoD0yGPjbpwvpO//oATDTFIQPKGc 8p4jZXYnyr7ihaQe2A283vz67eO0dnCi3JBs4= MIME-Version: 1.0 In-Reply-To: <4A19BBD3.8060409@freesbee.fr> References: <4A19BBD3.8060409@freesbee.fr> Date: Sun, 24 May 2009 23:49:01 +0200 Message-ID: Subject: Re: [MiNT] anonymous structs and C99 From: Miro Kropacek To: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= Cc: "[MiNT] Mailing-List" Content-Type: multipart/alternative; boundary=000e0cd25192312905046aaf7653 X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: miro.kropacek@gmail.com Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: --000e0cd25192312905046aaf7653 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, That kind of syntax is a Microsoft extension ;-) > You can use it along with -std=c99 if you add -fms-extensions > Well, if you want to be standard compliant, it is not a good idea. I agree, I don't like non-standard C code, too. VC++ drives me crazy, its C compiler lacks C99 declarations in the middle of function body so I must declare all variables at the beginning, awful. Funny that '//' comments are ok. (yes I know I can compile it as C++ code but this isn't solution) > Then you can use a.u.pointer1 > Of course, no cast is required ! Yes but it involves that 'u' everytime, it has no use for programmer since it's dummy variable and only makes code worser to understand (but one could say the same about this union trick / extension :) Btw Mariusz: naming that union caused gcc to complain even in non-C99 mode, the same error :) Anyway, thank you for your help, it seems I must learn to live with that additional union name... -- MiKRO / Mystic Bytes http://mikro.atari.org --000e0cd25192312905046aaf7653 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

That kind of syntax is a Microsoft extension ;-)
You can use it along with -std=3Dc99 if you add -fms-extensions
Well, if you want to be standard compliant, it is not a good idea.
I agree, I don't like non-standard C code, too. VC++ drives me= crazy, its C compiler lacks C99 declarations in the middle of function bod= y so I must declare all variables at the beginning, awful. Funny that '= //' comments are ok. (yes I know I can compile it as C++ code but this = isn't solution)
=A0
Then you= can use a.u.pointer1
Of course, no cast is required !
Yes but it involves that '= u' everytime, it has no use for programmer since it's dummy variabl= e and only makes code worser to understand (but one could say the same abou= t this union trick / extension :)

Btw Mariusz: naming that union caused gcc to complain even in non= -C99 mode, the same error :)

Anyway, thank you for your help, it see= ms I must learn to live with that additional union name...

--
MiKRO / Mystic Bytes
http://mikro.ata= ri.org
--000e0cd25192312905046aaf7653--