summaryrefslogtreecommitdiff
path: root/ntpshmread.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-30 17:10:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-30 17:10:53 -0400
commit28bf37132d86cc59320e21d843960d086cef664c (patch)
treebf085b5f89f1d1061b6a88ecc66c50721b13d86c /ntpshmread.c
parentecb7e1ff3ec73000918c56861c55258c2d4deada (diff)
downloadgpsd-28bf37132d86cc59320e21d843960d086cef664c.tar.gz
Retire splint from our set of static analyzers.
The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
Diffstat (limited to 'ntpshmread.c')
-rw-r--r--ntpshmread.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/ntpshmread.c b/ntpshmread.c
index c8ebec00..c75410be 100644
--- a/ntpshmread.c
+++ b/ntpshmread.c
@@ -15,17 +15,14 @@
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
-#ifndef S_SPLINT_S
#include <unistd.h>
-#endif /* S_SPLINT_S*/
#include "ntpshm.h"
#include "compiler.h"
-struct shmTime /*@null@*/ *shm_get(const int unit, const bool create, const bool forall)
+struct shmTime *shm_get(const int unit, const bool create, const bool forall)
/* initialize a SHM segment */
{
- /*@-mustfreefresh@*/
struct shmTime *p = NULL;
int shmid;
@@ -43,10 +40,8 @@ struct shmTime /*@null@*/ *shm_get(const int unit, const bool create, const bool
return NULL;
}
return p;
- /*@+mustfreefresh@*/
}
-/*@-statictrans@*/
char *ntp_name(const int unit)
/* return the name of a specified segment */
{
@@ -56,9 +51,8 @@ char *ntp_name(const int unit)
return name;
}
-/*@+statictrans@*/
-enum segstat_t ntp_read(/*@null@*/struct shmTime *shm_in, /*@out@*/struct shm_stat_t *shm_stat, const bool consume)
+enum segstat_t ntp_read(struct shmTime *shm_in, struct shm_stat_t *shm_stat, const bool consume)
/* try to grab a sample from the specified SHM segment */
{
volatile struct shmTime shmcopy, *shm = shm_in;
@@ -71,7 +65,6 @@ enum segstat_t ntp_read(/*@null@*/struct shmTime *shm_in, /*@out@*/struct shm_st
return NO_SEGMENT;
}
- /*@-type@*//* splint is confused about struct timespec */
shm_stat->tvc.tv_sec = shm_stat->tvc.tv_nsec = 0;
clock_gettime(CLOCK_REALTIME, &shm_stat->tvc);
@@ -172,7 +165,6 @@ enum segstat_t ntp_read(/*@null@*/struct shmTime *shm_in, /*@out@*/struct shm_st
shm_stat->status = BAD_MODE;
break;
}
- /*@-type@*/
/*
* leap field is not a leap offset but a leap notification code.