Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2000:
[Freeciv-Dev] Re: OSF1 V4.0D 878 alpha port
Home

[Freeciv-Dev] Re: OSF1 V4.0D 878 alpha port

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Argiolas Nicola <argiolas@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: OSF1 V4.0D 878 alpha port
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 14 Oct 2000 17:43:28 +0100

Argiolas Nicola <nick@xxxxxxxxxxxxxx> writes:

> On 13 Oct 2000, Gaute Strokkenes wrote:
> 
> > 
> > An ANSI compiler is required...
> 
>       Behind the word ANSI there is world of problems... :( My K&R
> manual reports that the #-commands can be started after an arbitrary
> sequence of white spaces and this means that my preprocessor (but not the
> compiler!) is not strictly ANSI and you're right.
> 
>         But now I ask you: is it better to leave that spaces in the code
> (without IMHO making it more readable) or remove them and make the code
> more portable?

Dunno.  Point out the places where it's done, and someone might do
something about it.  Note that I'm not the person that you'll have to
convince to get any changes into Freeciv.

> > >   2. the char variables are unsigned by default in GCC,
> > 
> > You're wrong.  A char are signed by default in GCC, for consistency
> > with other integer types.
> 
>         This is true 

Actually, we were both wrong.  It seems to be platform dependent, even
with GCC.  You can still override it with -funsigned-char or
-fsigned-char, I think.

>         (I've now done some tests) but in this case I simply
> followed which K&R says: the signed keyword is introduced (in the
> ANSI draft, in the 1988) to 'transform' a char in signed char, for
> the other interger types this keyword is redundant... so GCC doesn't
> follow this 'rule'.

Well, K&R isn't the standard.  'signed' would not be the only
redundant keyword in 'C', consider 'auto', for instance.

>         But in this case (the xpm cursors and the icons) the problem
> is another: XCreateBitmapFromData wants a char (i.e. in gcc a signed
> char) string in the 'data' field but the datas passed are
> unsigned. GCC make a casting without any warning (I've also tested
> this): I suppose because gcc doesn't change anything in the
> conversion. In this case is better IMHO to declare the cursors
> directly char (again, in gcc signed char), and again the code
> becomes more portable.

I'm not sure I see what could go wrong here.  But then again, I know
next to nothing about X.

-- 
Big Gaute (not to be confused with LG)
NOW do I get to blow out the CANDLES??



[Prev in Thread] Current Thread [Next in Thread]