Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] Re: Unit move rate cleanup (PR#1343)
Home

[Freeciv-Dev] Re: Unit move rate cleanup (PR#1343)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Unit move rate cleanup (PR#1343)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Thu, 11 Apr 2002 04:13:59 -0400

At 01:51 AM 02/03/25 -0800, Raahul Kumar wrote:
>
>--- "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> wrote:
>> On Sun, 24 Mar 2002, Raahul Kumar wrote:

>> +  default:
>> +    assert(0);
>> +    exit(1);
>> +    move_rate = -1;
>> 
>> No, never exit(1) when the game can be continued in a playable state!
>
>Playable???? The only possible way for a negative move cost to exist means
>memory has been overwritten. I think it's better to exit with a log message
>than continue with an unpredictably buggy program. I don't want Freeciv to be
>some sort of security hole.

Sea moves are stored as negative values. It is wrong to assume that
you know every way that something might come to pass ...

But more to the point, asserts and exceptions are very bad as Per says.

You might as well let the program fault itself as do it in most of the
cases where asserts are used in Freeciv.

A good user friendly solution is to allow the game to continue to a 
save point, or do a game save before trashing some poor user's 6 hour
session. User's really don't appreciate your developer sentiments in
general.
 
>> And if you must exit, first call freelog(LOG_FATAL, ...) for a proper
>> error message, and then do exit(EXIT_FAILURE).

At the minimum ... I agree.

>__________________________________________________
>Do You Yahoo!?
>Yahoo! Movies - coverage of the 74th Academy Awards®
>http://movies.yahoo.com/

Cheers,
RossW
=====




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