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: <rf13@xxxxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Compiler-warnings
From: Stepan Roh <stepan@xxxxxxxx>
Date: Wed, 24 Jan 2001 22:09:14 +0100 (CET)


On Wed, 24 Jan 2001, Raimar Falke wrote:

> gcc -Wall gives:
> a.c: In function `main':
> a.c:10: warning: array subscript has type `char'
>
> So it looks like gcc will accept signed or unsigned char as array
> subscripts. It can also be done using int. Both solution will silence
> the warning but maybe there is also something else to consider.

There is a gcc option -Wchar-subscripts (citation from info docs
follows), which is enabled with -Wall (and can be disabled with
-Wno-char-subscripts).

`-Wchar-subscripts'
     Warn if an array subscript has type `char'.  This is a common cause
     of error, as programmers often forget that this type is signed on
     some machines.

Have a nice day.

Stepan Roh




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