Skip to content

Commit

Permalink
[coverity] Add Coverity user model
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Mar 22, 2017
1 parent f032556 commit 65a3518
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions contrib/coverity/model.c
@@ -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 ) {
}

0 comments on commit 65a3518

Please sign in to comment.