From mint-bounce@lists.fishpool.fi  Fri May 21 18:40:46 2010
X-Squirrel-UserHash: EhVcX1lFRQVaRwYcDQ==
X-Squirrel-FromHash: UANfXltBRAc=
Message-ID: <43070bbbe5e61f8e5d1ea95a671f4013-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYOW0F0ADpUX1hbRU0DWl5c-webmailer2@server08.webmailer.hosteurope.de>
In-Reply-To: <4BF70510.4050704@freesbee.fr>
References: 
    <8e7396f3b18992df2cdbd355b37ce16e-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYPWkF+ATpUX1hbQkUGWVpe-webmailer2@server01.webmailer.hosteurope.de>
    <4BF45B4D.7040706@freesbee.fr>
    <24babc22984cc1db69b51c60b4b755a6-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUBFBDBTXF5bVkYOW0F0ADpUX1hbRUIGWV5a-webmailer2@server08.webmailer.hosteurope.de>
    <4BF70510.4050704@freesbee.fr>
Date: Sat, 22 May 2010 00:39:05 +0200
Subject: Re: [MiNT] gcc-4.4.3 usage
From: "Ole Loots" <ole@monochrom.net>
To: =?iso-8859-1?Q?=22Vincent_Rivi=E8re=22?= <vincent.riviere@freesbee.fr>
Cc: mint@lists.fishpool.fi
Reply-To: ole@monochrom.net
User-Agent: Host Europe Webmailer/1.0
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-HE-Access: Yes
X-bounce-key: webpack.hosteurope.de;ole@monochrom.net;1274481577;e2846c75;
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: ole@monochrom.net
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>

Hello,

Am Sa, 22.05.2010, 00:11 schrieb Vincent Rivière:

> First, which compiler are you using ?

Native gcc 4.4.3 with aranym

>
> I believe you have not found the correct definition of min().

I found the definition in one of the sources shiped with netsurf, thats
the project I'm trying to port.

> My cross-compiler is shipped with the PML math library, and there is that
> in
> <math.h>:
>
> #  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.

I did only post the warnings, errors follow after the warning:
expected ; before _x
expected ; before _y

etc.


> And typeof is a GCC built-in (like sizeof), it should not be seen as a
> function. Maybe your project use special compilation settings ?

The projects Makefile is somewhat silent. I found these Flags, but that
doesn't mean there can't be other flags passed to gcc:

-W -Wall -Wundef -Wpointer-arith \
	-Wcast-align -Wwrite-strings -Wstrict-prototypes \
	-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
	-Wnested-externs

-std=c99 -g -I. -Dsmall $(WARNFLAGS) \
		-D_BSD_SOURCE \
		-D_XOPEN_SOURCE=600 \
		-D_POSIX_C_SOURCE=200112L  \


>
> 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 <math.h> is not yet fixed.

Yes, that fixed the warnings / errors.

Thanks!


