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 /test_packet.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 'test_packet.c')
-rw-r--r-- | test_packet.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/test_packet.c b/test_packet.c index e8f6e34e..3c27025c 100644 --- a/test_packet.c +++ b/test_packet.c @@ -9,9 +9,7 @@ #include <ctype.h> #include <sys/types.h> #include <fcntl.h> -#ifndef S_SPLINT_S #include <unistd.h> -#endif /* S_SPLINT_S */ #include "gpsd.h" @@ -27,7 +25,6 @@ struct map }; /* *INDENT-OFF* */ -/*@ -initallelements +charint -usedef @*/ static struct map singletests[] = { /* NMEA tests */ { @@ -235,11 +232,9 @@ static struct map singletests[] = { .type = RTCM3_PACKET, }, }; -/*@ +initallelements -charint +usedef @*/ /* *INDENT-ON* */ /* *INDENT-OFF* */ -/*@ -initallelements +charint -usedef @*/ static struct map runontests[] = { /* NMEA tests */ { @@ -250,20 +245,17 @@ static struct map runontests[] = { NMEA_PACKET, }, }; -/*@ +initallelements -charint +usedef @*/ /* *INDENT-ON* */ static int packet_test(struct map *mp) { - /*@-compdestroy@*/ struct gps_lexer_t lexer; int failure = 0; lexer_init(&lexer); lexer.errout.debug = verbose; - /*@i@*/ memcpy(lexer.inbufptr = lexer.inbuffer, mp->test, mp->testlen); + memcpy(lexer.inbufptr = lexer.inbuffer, mp->test, mp->testlen); lexer.inbuflen = mp->testlen; - /*@ -compdef -uniondef -usedef -formatcode @*/ packet_parse(&lexer); if (lexer.type != mp->type) printf("%2zi: %s test FAILED (packet type %d wrong).\n", @@ -276,13 +268,11 @@ static int packet_test(struct map *mp) ++failure; } else printf("%2zi: %s test succeeded.\n", mp - singletests + 1, - mp->legend); /*@ +compdef +uniondef +usedef +formatcode @*/ + mp->legend); return failure; - /*@+compdestroy@*/ } -/*@ -compdef -uniondef -usedef -formatcode -compdestroy @*/ static void runon_test(struct map *mp) { struct gps_lexer_t lexer; @@ -291,7 +281,7 @@ static void runon_test(struct map *mp) lexer_init(&lexer); lexer.errout.debug = verbose; - /*@i@*/ memcpy(lexer.inbufptr = lexer.inbuffer, mp->test, mp->testlen); + memcpy(lexer.inbufptr = lexer.inbuffer, mp->test, mp->testlen); lexer.inbuflen = mp->testlen; (void)fputs(mp->test, stdout); do { @@ -299,7 +289,6 @@ static void runon_test(struct map *mp) //printf("packet_parse() returned %zd\n", st); } while (st > 0); } -/*@ +compdef +uniondef +usedef +formatcode +compdestroy@*/ static int property_check(void) { |