zephyr/tests/subsys
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
..
can/frame tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
dfu tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
fs tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
jwt tests: remove redundant CONFIG_HW_STACK_PROTECTION=y setting 2019-07-01 12:54:20 -07:00
logging tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
settings tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
shell/shell_history shell_history_test: make the test succeed on 64-bit targets 2019-07-04 07:24:56 -04:00
storage/flash_map tests: enable native_posix_64 testing 2019-07-16 10:41:11 -07:00
usb Revert "sys/util.h: helper macro to perform pointer difference" 2019-07-17 03:44:03 -04:00