check fill_value before passing to the C function