Found. Credits to Miroslav Urbanek from Charles University in Prague for a hint.
-(define-alien-routine ("ddot_" ddot) void +(define-alien-routine ("ddot_" ddot) double (defun dot (dx dy) (unless (= (length dx) (length dy)) (error "Vectors length does not match")) - (let ((n (length dx)) - (result 0.0d0)) - (sb-sys:with-pinned-objects (dx dy result) + (let ((n (length dx))) + (sb-sys:with-pinned-objects (dx dy)
The ddot procedure is designed to return a double, not a void. And the result variable is useless. Everything becomes so obvious after you become aware of them :-)
source share