[Freeciv-Dev] Re: Economy report (PR#1307)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Mar 08, 2002 at 05:13:21PM +0000, Ben Webb wrote:
> On Fri, 8 Mar 2002, Raimar Falke wrote:
>
> > I get some of these:
> > warning: cast increases required alignment of target type
>
> Well, the Alpha has pretty restrictive alignment when compared to
> x86. (I should point out that this is a completely different issue to my
> patch, though, which addresses the fact that sizeof(int) != sizeof(char *)
> on Alpha.)
>
> > If I understand this correct you shouldn't do
> > char *p;
> > int *q;
> > void *r;
> >
> > q=(int *)p;
> >
> > Since q may have stronger alignment requirements than p. Note that
> > q=r;
> > is ok. So we have to change the type of a generic pointer from char *
> > to void *. Correct?!
>
> I'm not an expert, but I believe the usual approach is to use the
> pointer type with the most restrictive alignment - usually (double *).
> Either that, or don't compile with -Wcast-align. ;)
You will get segv on Alpha ;)
But the serialize/unserialize code in attribute.c is bad. A lot of
wild casts which could break pretty fast on Alpha.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"The two rules for success in life are:
1) Never tell them everything you know."
- [Freeciv-Dev] Re: Economy report (PR#1307), (continued)
- [Freeciv-Dev] Re: Economy report (PR#1307), Raimar Falke, 2002/03/14
- [Freeciv-Dev] Re: Economy report (PR#1307), Ben Webb, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Jason Short, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Ben Webb, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Raimar Falke, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Ben Webb, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Raimar Falke, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Ben Webb, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307),
Raimar Falke <=
- [Freeciv-Dev] Re: Economy report (PR#1307), Ben Webb, 2002/03/08
- [Freeciv-Dev] Re: Economy report (PR#1307), Raimar Falke, 2002/03/08
[Freeciv-Dev] Re: Economy report (PR#1307), rf13, 2002/03/08
[Freeciv-Dev] Re: Economy report (PR#1307), Christian Knoke, 2002/03/08
[Freeciv-Dev] Re: Economy report (PR#1307), jdorje, 2002/03/14
|
|