From mint-bounce@lists.fishpool.fi Fri May 21 18:13:14 2010 Message-ID: <4BF70510.4050704@freesbee.fr> Date: Sat, 22 May 2010 00:11:28 +0200 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: mint@lists.fishpool.fi Subject: Re: [MiNT] gcc-4.4.3 usage References: <8e7396f3b18992df2cdbd355b37ce16e-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYPWkF+ATpUX1hbQkUGWVpe-webmailer2@server01.webmailer.hosteurope.de> <4BF45B4D.7040706@freesbee.fr> <24babc22984cc1db69b51c60b4b755a6-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYOW0F0ADpUX1hbRUIGWV5a-webmailer2@server08.webmailer.hosteurope.de> In-Reply-To: <24babc22984cc1db69b51c60b4b755a6-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYOW0F0ADpUX1hbRUIGWV5a-webmailer2@server08.webmailer.hosteurope.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o4LMDDCb003865 Ole Loots wrote: > layout.c: 1239: warning: implicit declaration of funtion 'typeof' > layout.c: 1239: warning: nested extern declaration of 'typeof' ... > width = min(max(box->min_width, available_width), > box->max_width); > > min is defined this way: > #define min(a,b) ((a)<(b)?(a):(b)) First, which compiler are you using ? I believe you have not found the correct definition of min(). My cross-compiler is shipped with the PML math library, and there is that in : # ifndef max # define max(x,y) ({typeof(x) _x=(x); typeof(y) _y=(y); if (_x>_y) _y=_x; _y;}) # define min(x,y) ({typeof(x) _x=(x); typeof(y) _y=(y); if (_x<_y) _y=_x; _y;}) # endif This is where that famous typeof is. However, it should be OK. Note that it generates only a warning, not an error. And typeof is a GCC built-in (like sizeof), it should not be seen as a function. Maybe your project use special compilation settings ? I have made some tests with GCC 4.5.0. I can see a similar warning only if I compile a small program with -Wall -ansi. However, it fails with other errors. Anyway, those definitions in math.h are not good. If these min and max definitions should be kept, they should use __extension__ and __typeof__ to avoid that kind of problems. To solve your problem temporarily: in layout.c, after all the includes put the following lines: #undef min #define min(a,b) ((a)<(b)?(a):(b)) #undef max #define max(a,b) ((a)>(b)?(a):(b)) Well, basically you have some hints, you should be able to fix your problem while is not yet fixed. -- Vincent Rivière