Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] Re: (PR#15840) common/dataio.c:700 is dubious
Home

[Freeciv-Dev] Re: (PR#15840) common/dataio.c:700 is dubious

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#15840) common/dataio.c:700 is dubious
From: "Guillaume Melquiond" <guillaume.melquiond@xxxxxxxxx>
Date: Sun, 12 Mar 2006 01:44:51 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15840 >

On 3/11/06, Jason Short wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=15840 >
>
> There are two cases we need to fix.
>
> For the stable braches (2.0 and 2.1) we only need to fix the casting
> problems since they can cause fatal errors.

This casting problem cannot cause any fatal error, since we are lucky
it happens on the very first field of the structure. So, if this is
your only concern with respect to the stable branches, there is
nothing to fix and the code should be left unchanged. The compiler
will complain, yet there won't be any kind of miscompilation.

However, I think that, even for the stable branches, all the fields
should be serialized and de-serialized. Losing information and leaving
some fields with random values cannot be a good thing in my opinion.
And then the casting problem would strike (on the second field of the
structure) and cause sigbusses and the like. The patch attached to my
previous mail adds the missing fields, and it fixes the code so that
there are no unaligned access.





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