* 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.
#if defined(AO_HAVE_compare_double_and_swap_double)
+#ifdef LINT2
+ volatile /* non-static */ AO_t AO_noop_sink;
+#endif
+
void AO_stack_push_release(AO_stack_t *list, AO_t *element)
{
AO_t next;
/* by Treiber. Pop is still safe, since we run into the ABA */
/* problem only if there were both intervening "pop"s and "push"es. */
/* In that case we still see a change in the version number. */
+# ifdef LINT2
+ /* Instruct static analyzer that element is not lost. */
+ AO_noop_sink = (AO_t)element;
+# endif
}
AO_t *AO_stack_pop_acquire(AO_stack_t *list)