I'm not sure it is as simple as changing the casts. I suspect you are *not* compiling for PC?
IMHO: The problem is that the buffers may not be aligned on word boundaries. This may result in problems on platforms which have a strict alignment. Another problem is that it may result in code which is very slow because words are read byte by byte. So the other part of the solution is to make sure all buffers are aligned to word boundaries. This is quite a bit of work though. Nico Coesel > -----Original Message----- > From: [email protected] [mailto:openocd- > [email protected]] On Behalf Of Hiroshi Ito > Sent: dinsdag 18 augustus 2009 13:13 > To: [email protected] > Subject: [Openocd-development] [PATCH] remove gcc warning > > arm_jtag.h: In function `arm7flip32': > arm_jtag.h:64: warning: cast increases required alignment of target type > arm_jtag.h: In function `arm_le_to_h_u32': > arm_jtag.h:70: warning: cast increases required alignment of target type ... > > I made 3 patch files, all warnings are same, but way of fixing are > different. > patch1: Cast from "uint32_t *" to "uint8_t *". > patch2: use union > patch3: "uint8_t *" => "ulong" => "uint32_t *" > > tested with gcc 3.4.5 and 4.4.0. > -------- > Hiroshi Ito > Media Lab. Inc., > URL http://www.mlb.co.jp ( Sorry, Japanese only. ) TEL +81-3-5294-7255 FAX > +81-3-5294-7256 > _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
