[Freeciv-Dev] Re: Compiler-warnings
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Compiler-warnings, Gerhard Killesreiter, 2001/01/23
- [Freeciv-Dev] Re: Compiler-warnings, Falk Hueffner, 2001/01/23
- [Freeciv-Dev] Re: Compiler-warnings, Gerhard Killesreiter, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Dirk Stoecker, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Gerhard Killesreiter, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Raimar Falke, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Gerhard Killesreiter, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Raimar Falke, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings,
Stepan Roh <=
- [Freeciv-Dev] Re: Compiler-warnings, Raimar Falke, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Tony Stuckey, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Stepan Roh, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Raimar Falke, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Falk Hueffner, 2001/01/24
- [Freeciv-Dev] Re: Compiler-warnings, Dirk Stoecker, 2001/01/25
[Freeciv-Dev] Re: Compiler-warnings, Reinier Post, 2001/01/24
[Freeciv-Dev] Re: Compiler-warnings, Dirk Stoecker, 2001/01/24
|
|