Ivan Maidanski [Mon, 24 Jul 2017 09:56:47 +0000 (12:56 +0300)]
Workaround 'unused result' code defects in list_atomic.template
* tests/list_atomic.template: Include stdlib.h (needed for exit()
prototype).
* tests/list_atomic.template [AO_HAVE_XSIZE_loadXX]
(XSIZE_list_atomicXX): Cast AO_XSIZE_loadXX() result to void.
* tests/list_atomic.template [AO_HAVE_XSIZE_fetch_and_addXX]: Cast
AO_XSIZE_fetch_and_addXX() result to void.
* tests/list_atomic.template [AO_HAVE_XSIZE_fetch_and_add1XX]
(XSIZE_list_atomicXX): Cast AO_XSIZE_fetch_and_add1XX() result to void.
* tests/list_atomic.template [AO_HAVE_XSIZE_fetch_and_sub1XX]
(XSIZE_list_atomicXX): Cast AO_XSIZE_fetch_and_sub1XX() result to void.
* tests/list_atomic.template [AO_HAVE_test_and_setXX]
(XSIZE_list_atomicXX): Cast AO_test_and_setXX() result to void.
* tests/list_atomic.template [AO_HAVE_XSIZE_compare_and_swapXX]
(XSIZE_list_atomicXX): Call exit(1) if AO_XSIZE_compare_and_swapXX
failed.
* tests/list_atomic.template [AO_HAVE_XSIZE_fetch_compare_and_swapXX]
(XSIZE_list_atomicXX): Call exit(1) if AO_XSIZE_fetch_compare_and_swapXX
failed.
Ivan Maidanski [Thu, 15 Jun 2017 22:14:13 +0000 (01:14 +0300)]
Add bdwgc mailing list online archive link to README
* README.md (Feedback, Contribution, Questions and Notifications):
Update information about accessing the mailing list archive (add link
to that at Narkive site).
Ivan Maidanski [Fri, 2 Jun 2017 04:44:15 +0000 (07:44 +0300)]
Update README about bugs reporting and new releases notification
* README.md (Download): Move (and update) information about bug reporting
to another section.
* README.md (Feedback, Contribution, Questions and Notifications): New
section.
* configure.ac (AC_INIT): Change URI for reporting bugs.
Ivan Maidanski [Thu, 11 May 2017 08:21:01 +0000 (11:21 +0300)]
Eliminate 'value shift followed by expansion' false code defect warning
* src/atomic_ops.c [AO_USE_NANOSLEEP] (AO_pause): Use "L" suffix for
shifted immediate value (1) to match the type of ts.tv_nsec.
* src/atomic_ops.c [!AO_USE_NANOSLEEP && AO_USE_WIN32_PTHREADS]
(AO_pause): Cast shifted immediate value (1) to DWORD to match Sleep
argument type.
* src/atomic_ops.c [!AO_USE_NANOSLEEP && !AO_USE_WIN32_PTHREADS]
(AO_pause): Store computed usec value to an intermediate int variable
(before storing it to tv.tv_usec) so that to avoid widening conversion
of shifted immediate int value (1); add comment.
Ivan Maidanski [Fri, 21 Apr 2017 07:10:58 +0000 (10:10 +0300)]
Workaround 'resource leak' false positives in AO_malloc, add_elements
* src/atomic_ops_stack.c [AO_HAVE_compare_double_and_swap_double
&& LINT2] (AO_noop_sink): New global volatile variable.
* src/atomic_ops_stack.c [AO_HAVE_compare_double_and_swap_double
&& LINT2] (AO_stack_push_release): Store element value to AO_noop_sink;
add comment.
* tests/test_atomic_include.template [AO_HAVE_storeXX && LINT2
&& AO_PREFER_GENERALIZED] (test_atomicXX): Initialize x local variable
(before AO_storeXX which can be defined using CAS); update comment.
* tests/test_atomic_include.template [AO_HAVE_short_storeXX && LINT2
&& AO_PREFER_GENERALIZED] (test_atomicXX): Initialize s local variable.
* tests/test_atomic_include.template [AO_HAVE_char_storeXX && LINT2
&& AO_PREFER_GENERALIZED] (test_atomicXX): Initialize b local variable.
* tests/test_atomic_include.template [AO_HAVE_int_storeXX && LINT2
&& AO_PREFER_GENERALIZED] (test_atomicXX): Initialize zz local variable.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_pop_explicit_aux_acquire): Replace AO_load to AO_load_acquire
when loaded value is compared to first; add comment.
Ivan Maidanski [Sat, 15 Apr 2017 06:56:36 +0000 (09:56 +0300)]
Use CLANG/GNUC_PREREQ macros in gcc/powerpc.h
* src/atomic_ops/sysdeps/gcc/powerpc.h: Use AO_GNUC_PREREQ() instead
of direct use of __GNUC[_MINOR]__; use AO_CLANG_PREREQ() instead of
direct use __clang_major__ and __clang_minor__.
Ivan Maidanski [Fri, 5 Aug 2016 19:03:12 +0000 (22:03 +0300)]
Use GCC atomic intrinsics for PowerPC 32/64 (GCC 4.8+ and clang 3.8+)
(Cherry-pick commit 8e62b6f from 'ppc-gcc-atomics' branch.)
* src/atomic_ops/sysdeps/gcc/powerpc.h: Include generic.h and do not
include all_aligned_atomic_load_store.h, test_and_set_t_is_ao_t.h if
GCC 4.8+ or clang 3.8+ unless AO_DISABLE_GCC_ATOMICS.
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_nop_full, AO_lwsync,
AO_nop_write, AO_nop_read, AO_load_acquire, AO_store_release,
AO_test_and_set, AO_test_and_set_release, AO_test_and_set_full,
AO_compare_and_swap, AO_compare_and_swap_acquire,
AO_compare_and_swap_release, AO_compare_and_swap_full,
AO_fetch_compare_and_swap, AO_fetch_compare_and_swap_acquire,
AO_fetch_compare_and_swap_release, AO_fetch_compare_and_swap_full,
AO_fetch_and_add, AO_fetch_and_add_acquire, AO_fetch_and_add_release,
AO_fetch_and_add_full, AO_T_IS_INT): Do not define if generic.h is
included.
* src/atomic_ops_malloc.c [SIZE_MAX && !CPPCHECK] (AO_SIZE_MAX): Cast
SIZE_MAX to size_t explicitly (to workaround incorrect definition
of SIZE_MAX - e.g. it is defined as ~0ULL in musl-tools which is not
correct for a 32-bit target).
Ivan Maidanski [Wed, 15 Mar 2017 08:22:26 +0000 (11:22 +0300)]
Refine configure messages when checking for compiler options
* configure.ac (AC_MSG_CHECKING, AC_MSG_RESULT): Refine message when
checking for a compiler option support (replace "gcc" with "compiler"),
and when reporting PIC option required; put string in [].
* configure.ac (AC_MSG_RESULT): Do not put string in quotes.
Ivan Maidanski [Wed, 1 Mar 2017 22:50:24 +0000 (01:50 +0300)]
Fix missing .exe for test filenames in Makefile (MinGW)
(fix commits ad82960, 13a17dd, ecd43ca)
* tests/Makefile.am (TESTS, check-without-test-driver): Add $(EXEEXT)
suffix to each item (test).
* tests/Makefile.am (TEST_OBJS): Reorder items (to match the that of
TESTS).
* tests/Makefile.am (check_PROGRAMS): Specify all items explicitly (so
that to have all items without the suffix as before this change).
Ivan Maidanski [Tue, 21 Feb 2017 08:43:42 +0000 (11:43 +0300)]
Update shared libraries version info to differentiate against v7.4.x
Version info "current" and "age" numbers are incremented, "revision"
number is reset to zero (indicating that programs using the previous
libraries version may use the new version as drop-in replacement).
Thus, version info is 2:0:1 now (both for libatomic_ops.so and
libatomic_ops_gpl.so).
* src/Makefile.am (LIBATOMIC_OPS_VER_INFO, LIBATOMIC_OPS_GPL_VER_INFO):
Change version info from 1:3:0 (used for libatomic_ops v7.4.x releases)
to 2:0:1.
Ivan Maidanski [Mon, 20 Feb 2017 20:30:55 +0000 (23:30 +0300)]
Fix 'unknown attribute no_sanitize' compiler warning (clang prior to v3.8)
* src/atomic_ops.h [!AO_ATTR_NO_SANITIZE_MEMORY && AO_MEMORY_SANITIZER]
(AO_ATTR_NO_SANITIZE_MEMORY): Do not define to no_sanitize attribute
unless clang-3.8+ (or not clang).
* tests/test_atomic_include.template [AO_HAVE_storeXX
&& AO_MEMORY_SANITIZER && AO_PREFER_GENERALIZED] (test_atomicXX):
Initialize x local variable (before AO_storeXX which can be defined
using CAS); add comment.
* tests/test_atomic_include.template [AO_HAVE_short_storeXX
&& AO_MEMORY_SANITIZER && AO_PREFER_GENERALIZED] (test_atomicXX):
Initialize s local variable.
* tests/test_atomic_include.template [AO_HAVE_char_storeXX
&& AO_MEMORY_SANITIZER && AO_PREFER_GENERALIZED] (test_atomicXX):
Initialize b local variable.
* tests/test_atomic_include.template [AO_HAVE_int_storeXX
&& AO_MEMORY_SANITIZER && AO_PREFER_GENERALIZED] (test_atomicXX):
Initialize zz local variable.
Ivan Maidanski [Mon, 20 Feb 2017 19:16:54 +0000 (22:16 +0300)]
Eliminate 'condition sizeof(long)>4 is always true' cppcheck style warning
* src/atomic_ops_malloc.c (msb): Cast (s >> 32) to unsigned int type
before assigning the result to v; check __SIZEOF_SIZE_T__ value (if
defined) to decide whether (s >> 32) is needed; move condition
(sizeof(size_t) > 4) to SIZEOF_SIZE_T_GT_4 macro (to eliminate cppcheck
false report that the condition is always true).
Ivan Maidanski [Mon, 20 Feb 2017 08:10:07 +0000 (11:10 +0300)]
Workaround 'AM_EXTRA_RECURSIVE_TARGETS not found in library' autoconf error
(fix commit 3b7e732)
* Makefile.am (.PHONY): Add check-nolink, check-nolink-local targets.
* Makefile.am (check-nolink): New target (which invokes existing
check-nolink-local in this Makefile and in tests/Makefile).
* configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Remove (this directive
is not supported by autoconf-1.12 and earlier).
Ivan Maidanski [Sat, 18 Feb 2017 07:23:33 +0000 (10:23 +0300)]
Add Makefile target to run all tests without test-driver
This could be used to catch errors reported by MemorySanitizer
(the traditional "make check" shows the tests with MSan errors as
skipped, so it does not lead to a non-zero exit code of make itself).
* tests/Makefile.am (check-without-test-driver): New phony target (to
compile, link and execute all tests not using test-driver).
Ivan Maidanski [Sat, 18 Feb 2017 06:21:58 +0000 (09:21 +0300)]
Add Makefile target (check-nolink) to compile all source without linking
Note: it is assumed --enable-shared is not passed to configure.
* Makefile.am (check-nolink-local): New Makefile phony target (just
redirects to "all").
* configure.ac: Define check-nolink by AM_EXTRA_RECURSIVE_TARGETS.
* tests/Makefile.am (TEST_OBJS): New variable (with a list of the test
.o files).
* tests/Makefile.am (check-nolink-local): New Makefile phony target
(forces all tests to be compiled but not linked).
Ivan Maidanski [Fri, 17 Feb 2017 20:48:23 +0000 (23:48 +0300)]
Refine documentation in Makefile.msft how to run all tests (MS VC)
* src/Makefile.msft: Refine comment about all tests execution
("make check" is redundant, it is enough to run only "make" to
auto-generate list_atomic.c and test_atomic_include.h).
Ivan Maidanski [Fri, 17 Feb 2017 20:27:19 +0000 (23:27 +0300)]
Move libraries version info to the beginning of Makefile.am
(code refactoring)
* src/Makefile.am (LIBATOMIC_OPS_VER_INFO, LIBATOMIC_OPS_GPL_VER_INFO):
New variable; add comment about the version update rule.
* src/Makefile.am (libatomic_ops_la_LDFLAGS,
libatomic_ops_gpl_la_LDFLAGS): Use LIBATOMIC_OPS_[GPL_]VER_INFO
instead direct hard-coding of version info.
Ivan Maidanski [Fri, 17 Feb 2017 08:51:30 +0000 (11:51 +0300)]
Travis CI: Also test with Memory and Unexpected Behavior sanitizers
Note: Currently an error found by MSan/UBSan does not cause Travis build
to fail, the log should be examined manually for the absence of
"MemorySanitizer" and "runtime error" character sequences (the error
messages are shown in red).