diff --git a/ext/nmatrix/math.cpp b/ext/nmatrix/math.cpp
index 880c1cd4..b288bafd 100644
--- a/ext/nmatrix/math.cpp
+++ b/ext/nmatrix/math.cpp
@@ -219,7 +219,7 @@ namespace nm {
 
     //we can't do det_exact on byte, because it will want to return a byte (unsigned), but determinants can be negative, even if all elements of the matrix are positive
     template <>
-    void det_exact_from_dense<uint8_t>(const int M, const void* A_elements, const int lda, void* result_arg) {
+    [[ noreturn ]] void det_exact_from_dense<uint8_t>(const int M, const void* A_elements, const int lda, void* result_arg) {
       rb_raise(nm_eDataTypeError, "cannot call det_exact on unsigned type");
     }
     /*
@@ -464,7 +464,7 @@ namespace nm {
       delete[] u;
     }
 
-    void raise_not_invertible_error() {
+    [[ noreturn ]] void raise_not_invertible_error() {
         rb_raise(nm_eNotInvertibleError,
             "matrix must have non-zero determinant to be invertible (not getting this error does not mean matrix is invertible if you're dealing with floating points)");
     }
diff --git a/ext/nmatrix/ruby_nmatrix.c b/ext/nmatrix/ruby_nmatrix.c
index 8073c8c6..b7dbed95 100644
--- a/ext/nmatrix/ruby_nmatrix.c
+++ b/ext/nmatrix/ruby_nmatrix.c
@@ -1144,7 +1144,7 @@ static VALUE nm_init_new_version(int argc, VALUE* argv, VALUE self) {
   // Get the shape.
   size_t  dim;
   size_t* shape = interpret_shape(shape_ary, &dim);
-  void*   init;
+  void*   init = NULL;
   void*   v = NULL;
   size_t  v_size = 0;