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 /ais_json.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 'ais_json.c')
-rw-r--r-- | ais_json.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -23,11 +23,10 @@ representations to libgps structures. #include "libgps.h" /* kluge because we don't want to include gpsd.h here */ -extern int gpsd_hexpack(/*@in@*/const char *, /*@out@*/char *, size_t); +extern int gpsd_hexpack(const char *, char *, size_t); -/*@ -mustdefine @*/ static void lenhex_unpack(const char *from, - size_t * plen, /*@out@*/ char *to, size_t maxlen) + size_t * plen, char *to, size_t maxlen) { char *colon = strchr(from, ':'); @@ -36,16 +35,13 @@ static void lenhex_unpack(const char *from, (void)gpsd_hexpack(colon + 1, to, maxlen); } -/*@ +mustdefine @*/ int json_ais_read(const char *buf, char *path, size_t pathlen, struct ais_t *ais, - /*@null@*/ const char **endptr) + const char **endptr) { /* collected but not actually used yet */ bool scaled; - /*@-compdef@*//* splint is confused by storage declared in the .i file */ - /*@-nullstate@*/ #define AIS_HEADER \ {"class", t_check, .dflt.check = "AIS"}, \ @@ -82,7 +78,6 @@ int json_ais_read(const char *buf, memset(ais, '\0', sizeof(struct ais_t)); - /*@-usedef@*/ if (strstr(buf, "\"type\":1,") != NULL || strstr(buf, "\"type\":2,") != NULL || strstr(buf, "\"type\":3,") != NULL) { @@ -464,7 +459,6 @@ int json_ais_read(const char *buf, return JSON_ERR_MISC; } return status; - /*@+compdef +usedef +nullstate@*/ } #endif /* SOCKET_EXPORT_ENABLE */ |