]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[coverity] Add Coverity user model
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Mar 2017 14:46:03 +0000 (16:46 +0200)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Mar 2017 14:46:03 +0000 (16:46 +0200)
Add a trivial model file to prevent Coverity from making various
incorrect assumptions about functions where the iPXE behaviour
diverges from POSIX or Linux norms.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
contrib/coverity/model.c [new file with mode: 0644]

diff --git a/contrib/coverity/model.c b/contrib/coverity/model.c
new file mode 100644 (file)
index 0000000..15535d4
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Coverity modelling file
+ *
+ */
+
+typedef long off_t;
+typedef void * userptr_t;
+typedef long long time_t;
+struct tm;
+
+/* Inhibit use of built-in models for functions where Coverity's
+ * assumptions about the modelled function are incorrect for iPXE.
+ */
+char * strerror ( int errno ) {
+}
+void copy_from_user ( void *dest, userptr_t src, off_t src_off, size_t len ) {
+}
+time_t mktime ( struct tm *tm ) {
+}
+int getchar ( void ) {
+}