summaryrefslogtreecommitdiff
path: root/gpspipe.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 /gpspipe.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 'gpspipe.c')
-rw-r--r--gpspipe.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/gpspipe.c b/gpspipe.c
index 8ceea716..978b8216 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -38,9 +38,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
-#ifndef S_SPLINT_S
#include <unistd.h>
-#endif /* S_SPLINT_S */
#include "gpsd.h"
@@ -79,14 +77,12 @@ static void open_serial(char *device)
}
/* Clear struct for new port settings. */
- /*@i@*/ bzero(&newtio, sizeof(newtio));
+ bzero(&newtio, sizeof(newtio));
-#ifndef S_SPLINT_S
/* make it raw */
(void)cfmakeraw(&newtio);
-#endif /* S_SPLINT_S */
/* set speed */
- /*@i@*/ (void)cfsetospeed(&newtio, BAUDRATE);
+ (void)cfsetospeed(&newtio, BAUDRATE);
/* Clear the modem line and activate the settings for the port. */
(void)tcflush(fd_out, TCIFLUSH);
@@ -122,7 +118,6 @@ static void usage(void)
"You must use -o if you use -d.\n");
}
-/*@ -compdestroy @*/
int main(int argc, char **argv)
{
char buf[4096];
@@ -148,7 +143,6 @@ int main(int argc, char **argv)
char *serialport = NULL;
char *outfile = NULL;
- /*@-branchstate@*/
flags = WATCH_ENABLE;
while ((option = getopt(argc, argv, "?dD:lhrRwStT:vVn:s:o:pPu2")) != -1) {
switch (option) {
@@ -226,7 +220,6 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
}
- /*@+branchstate@*/
/* Grok the server, port, and device. */
if (optind < argc) {
@@ -251,13 +244,11 @@ int main(int argc, char **argv)
}
/* Daemonize if the user requested it. */
- /*@ -unrecog @*/
if (daemonize)
if (daemon(0, 0) != 0)
(void)fprintf(stderr,
"gpspipe: demonization failed: %s\n",
strerror(errno));
- /*@ +unrecog @*/
/* Sleep for ten seconds if the user requested it. */
if (sleepy)
@@ -286,14 +277,12 @@ int main(int argc, char **argv)
if (serialport)
open_serial(serialport);
- /*@ -nullpass -onlytrans @*/
if (gps_open(source.server, source.port, &gpsdata) != 0) {
(void)fprintf(stderr,
"gpspipe: could not connect to gpsd %s:%s, %s(%d)\n",
source.server, source.port, gps_errstr(errno), errno);
exit(EXIT_FAILURE);
}
- /*@ +nullpass +onlytrans @*/
if (profile)
flags |= WATCH_TIMING;
@@ -340,8 +329,7 @@ int main(int argc, char **argv)
struct timespec now;
struct tm *tmp_now;
- /*@-type@*//* splint is confused about struct timespec */
- /*@i2@*/(void)clock_gettime(CLOCK_REALTIME, &now);
+ (void)clock_gettime(CLOCK_REALTIME, &now);
tmp_now = localtime((time_t *)&(now.tv_sec));
(void)strftime(tmstr, sizeof(tmstr), format, tmp_now);
new_line = 0;
@@ -369,7 +357,6 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
}
- /*@+type@*/
if (fputc(c, fp) == EOF) {
fprintf(stderr, "gpspipe: write error, %s(%d)\n",
strerror(errno), errno);
@@ -430,7 +417,6 @@ int main(int argc, char **argv)
exit(EXIT_SUCCESS);
}
-/*@ +compdestroy @*/
static void spinner(unsigned int v, unsigned int num)
{