Hei hei, 

Am 2013-03-27 18:57, schrieb Michael Olbrich:
> When does this issue happen anyways? I've never seen it.

The problem is in one of the test programs, code was like this before:

  uint16_t *tab_rp_registers;
  /* load some data to this poiner */
  *((uint32_t *)tab_rp_registers) = something_else;

On ARMv5 (which we use here) and older the CPU can not access memory
bytewise, so fetching an 2 or 4 byte integer from an unaligned memory
address leads to wrong data. Get a detailed explanation here:
http://lecs.cs.ucla.edu/wiki/index.php/XScale_alignment

The cast from an *uint16_t to an *uint32_t could lead to such an
unaligned access. You can let the compiler spot such things and warn you
with -Wcast-align (which is btw not part of -Wall) and we set
-Wcast-align globally to spot those things in our own code for ARMv5
architecture.

The problem is with libmodbus3 setting -Werror which leads to all
warnings be handled as errors and thus the failing build.

In short: the combination of -Werror in libmodbus and -Wcast-align in
our PTXCONF_TARGET_EXTRA_CFLAGS triggered this.

> But I like the change, because we compile less that way.

Someone who wants the test would have to edit the rules then, but she
would need to edit the targetinstall rule then anyway.

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

-- 
ptxdist mailing list
[email protected]

Reply via email to