zephyr/tests/subsys/usb
Peter A. Bigot 765c06376c Revert "sys/util.h: helper macro to perform pointer difference"
This reverts commit 755cc644cc.

This approach is problematic in several ways.  First, `intptr_t` could
cause undefined behavior in the subtraction when the pointer converts to
a negative value.  Except in weird cases where the sign of the pointer
identifies a memory domain (like kernel vs userspace) I'm unaware of any
valid use of `intptr_t`.

Second, this macro was created to address a special need that cannot
rely on defined behavior: i.e. to ensure that data definitions are
placed in contiguous space and access is provided through linker-defined
symbols, for which the language required alignment and continuity is not
guaranteed.

A macro that calculates the span between linker symbols has very
different semantics than one that calculates the difference between
pointers.  Replace the global PTR_DIFF with a documented local macro
that tests what's necessary without risking integer overflow.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-17 03:44:03 -04:00
..
bos print format: adjust specifiers to be compatible with a 64-bit build 2019-07-11 20:12:26 -07:00
desc_sections Revert "sys/util.h: helper macro to perform pointer difference" 2019-07-17 03:44:03 -04:00
device test/usb: fix pointer type mismatch 2019-07-05 14:16:50 -04:00
os_desc tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00