warn about undefined behavior

fixes #815