[Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 08 Oct 2001, vze2zq63@xxxxxxxxxxx wrote:
> Greg Wooledge wrote:
>>
>> Raimar Falke (hawk@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
>>
>> > > static void smooth_map(void)
>> > > {
>> > > + int new_hmap[map.xsize * map.ysize];
>> >
>> > I think that such constructs aren't allow in C. IMHO the size has
>> > to be a compile time constant. Either I'm wrong and this is ok
>> > for local function variables or it is an gcc extension.
>>
>> You're correct -- it's not allowed in standard C. You need to use
>> one of the malloc() family, and free() when you're done.
>
> Wow, that's too bad. I guess I'll fix it - and all of the other
> places where I've done the same thing.
>
> I sometimes forget that gcc does lots of "extensions" to standard C.
Actually, variable-size arrays is in C99. Off course, that doesn't
mean that we can rely on it.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Let's climb to the TOP of that MOUNTAIN and think about STRIP MINING!!
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), (continued)
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Jason Dorje Short, 2001/10/07
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Jason Dorje Short, 2001/10/07
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Raimar Falke, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Greg Wooledge, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Jason Dorje Short, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Jason Dorje Short, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Raimar Falke, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Jason Dorje Short, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Raimar Falke, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991), Raimar Falke, 2001/10/08
- [Freeciv-Dev] Re: PATCH: fix for smooth_map (PR#991),
Gaute B Strokkenes <=
|
|