diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-30 17:10:53 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-30 17:10:53 -0400 |
commit | 28bf37132d86cc59320e21d843960d086cef664c (patch) | |
tree | bf085b5f89f1d1061b6a88ecc66c50721b13d86c /driver_garmin_txt.c | |
parent | ecb7e1ff3ec73000918c56861c55258c2d4deada (diff) | |
download | gpsd-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 'driver_garmin_txt.c')
-rw-r--r-- | driver_garmin_txt.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c index adeaf361..d7781159 100644 --- a/driver_garmin_txt.c +++ b/driver_garmin_txt.c @@ -141,7 +141,7 @@ invalid data. **************************************************************************/ static int gar_decode(const struct gps_context_t *context, const char *data, const size_t length, - const char *prefix, const double dividor, /*@out@*/ + const char *prefix, const double dividor, double *result) { char buf[10]; @@ -150,8 +150,6 @@ static int gar_decode(const struct gps_context_t *context, int offset = 1; /* assume one character prefix (E,W,S,N,U,D, etc) */ long int intresult; - /* splint is buggy here, thinks buf can be a null pointer */ - /*@ -mustdefine -nullderef -nullpass @*/ if (length >= sizeof(buf)) { gpsd_log(&context->errout, LOG_ERROR, "internal buffer too small\n"); return -1; @@ -196,7 +194,6 @@ static int gar_decode(const struct gps_context_t *context, gpsd_log(&context->errout, LOG_WARN, "Invalid value %s\n", buf); return -1; } - /*@ +mustdefine +nullderef +nullpass @*/ intresult = atol(buf + offset); if (intresult == 0L) @@ -216,12 +213,11 @@ static int gar_decode(const struct gps_context_t *context, static int gar_int_decode(const struct gps_context_t *context, const char *data, const size_t length, const unsigned int min, const unsigned int max, - /*@out@*/ unsigned int *result) + unsigned int *result) { char buf[6]; unsigned int res; - /*@ -mustdefine @*/ if (length >= sizeof(buf)) { gpsd_log(&context->errout, LOG_ERROR, "internal buffer too small\n"); return -1; @@ -236,7 +232,6 @@ static int gar_int_decode(const struct gps_context_t *context, return -2; } - /*@ -nullpass @*//* splint bug */ if (strspn(buf, "0123456789") != length) { gpsd_log(&context->errout, LOG_WARN, "Invalid value %s\n", buf); return -1; @@ -252,7 +247,6 @@ static int gar_int_decode(const struct gps_context_t *context, max); return -1; } - /*@ +mustdefine +nullpass @*/ } |