[Freeciv-Dev] Re: Economy report (PR#1307)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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. ;)
Ben
--
ben@xxxxxxxxxxxxxxxxxxxxxx http://bellatrix.pcl.ox.ac.uk/~ben/
"Ice formed on the butler's upper slopes."
- 'Pigs Have Wings (1952), ch. 5, pt. i', P.G. Wodehouse
- [Freeciv-Dev] Re: Economy report (PR#1307), (continued)
- [Freeciv-Dev] Re: Economy report (PR#1307), Raimar Falke, 2002/03/08
- [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 <=
- [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), 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
|
|