loci: rewrite assertions
Assertion failure now calls abort() instead of dereferencing a null pointer.
The noreturn attribute is important for static analysis.
diff --git a/c_gen/templates/of_utils.c b/c_gen/templates/of_utils.c
index ba22536..373ad59 100644
--- a/c_gen/templates/of_utils.c
+++ b/c_gen/templates/of_utils.c
@@ -35,6 +35,8 @@
****************************************************************/
#include <loci/of_utils.h>
+#include <stdio.h>
+#include <stdlib.h>
/**
@@ -76,3 +78,9 @@
return rv;
}
+void
+loci_assert_fail(const char *msg, const char *file, unsigned int line)
+{
+ fprintf(stderr, "\\nASSERT %s. %s:%d\\n", msg, file, line);
+ abort();
+}