Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: Compiler-warnings
Home

[Freeciv-Dev] Re: Compiler-warnings

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Compiler-warnings
From: Dirk Stoecker <stoecker@xxxxxxxxxxxxxx>
Date: Wed, 24 Jan 2001 18:30:15 +0100 (MET)

Hi,

> Falk Hueffner <falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > They are very significant on systems where 'char' defaults to 'signed
> > char' (like ARM), and the characters are in the 128...255 range, since
> > then a negative offset will be taken, which is rarely what was
> > meant. This especially evil since often only 7 bit characters are in
> > use, so it goes unnotified for a while.
> 
> Hmm.
> 
> Dirk Stoecker <stoecker@xxxxxxxxxxxxxx> writes:
> 
> > I have equal messages (and lots of others) on Amiga. This message should
> > be (if equal to SAS-C) a warning, that char types are passed as function
> > argument, e.g. func(char a, int b). This is "possible" portability
> > problem, as in real the passed argument is of type int.
> > 
> > I disabled this warning as there are too much in the source to change them
> > all. I'm still on removing some of the other portability warnings SAS-C
> > produces (ai directory is warning free [except of disabled ones :-]).
> 
> Hmmm. Hmm.
> 
> To be honest. I did not understand a word. But thanks anyway :-)

A function maybe called with argument of type char (8 bit). But the
compiler does not do that, but internally uses int (usally 32 bit)
normally. Thus there maybe portability problems.
This can be the problem of signed/unsigned mode Falk talks about or
others.

> The question remains:
> Should I prepare a list of those warnings? 

Nobody will fix them I think, but please be so kind and send me the list.
Maybe I'm so dumb and will fix them any day (like I will fix all my SAS-C
warnings also).

> _Iff_ somebody would explain to me what to change in the source, I
> _might_ try my hands on a patch. To silence the warnings, or do
> whatever to them.

Change every function prototype, where char is used to int and check all
the function calls for side-effects.

Ciao
 ____  _ _  ____  _ _    _ _  ____
|    |  |  |    |  | \  / |  |    | the cool Gremlin from Bischofswerda
|  __   |   ____|  |  \/  |  |    | WWW: http://home.pages.de/~stoecker/
|    |  |  |       |      |  |    | PGP key available on www page.
|____| _|_ |____| _|_    _|_ |____| I hope AMIGA never ends to make fun!




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