summaryrefslogtreecommitdiff
path: root/test_json.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 /test_json.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 'test_json.c')
-rw-r--r--test_json.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/test_json.c b/test_json.c
index 0891df9d..d054e273 100644
--- a/test_json.c
+++ b/test_json.c
@@ -57,14 +57,12 @@ static void assert_uinteger(char *attr, uint fld, uint val)
static void assert_boolean(char *attr, bool fld, bool val)
{
- /*@-boolcompare@*/
if (fld != val) {
(void)fprintf(stderr,
"'%s' boolean attribute eval failed, value = %s.\n",
attr, fld ? "true" : "false");
exit(EXIT_FAILURE);
}
- /*@+boolcompare@*/
}
/*
@@ -81,7 +79,6 @@ static void assert_real(char *attr, double fld, double val)
}
}
-/*@ -fullinitblock @*/
static struct gps_data_t gpsdata;
@@ -114,7 +111,6 @@ static char *stringptrs[3];
static char stringstore[256];
static int stringcount;
-/*@-type@*/
static const struct json_array_t json_array_3 = {
.element_type = t_string,
.arr.strings.ptrs = stringptrs,
@@ -123,7 +119,6 @@ static const struct json_array_t json_array_3 = {
.count = &stringcount,
.maxlen = sizeof(stringptrs)/sizeof(stringptrs[0]),
};
-/*@+type@*/
/* Case 4: test defaulting of unspecified attributes */
@@ -167,7 +162,6 @@ struct dumbstruct_t {
static struct dumbstruct_t dumbstruck[5];
static int dumbcount;
-/*@-type@*/
static const struct json_attr_t json_attrs_6_subtype[] = {
{"name", t_string, .addr.offset = offsetof(struct dumbstruct_t, name),
.len = 64},
@@ -185,7 +179,6 @@ static const struct json_attr_t json_attrs_6[] = {
.addr.array.maxlen = sizeof(dumbstruck)/sizeof(dumbstruck[0])},
{NULL},
};
-/*@+type@*/
/* Case 7: test parsing of version response */
@@ -218,14 +211,12 @@ static const char *json_str9 = "{\"parts\":[]}";
static const char *json_str10 = "[23,-17,5]";
static int intstore[4], intcount;
-/*@-type@*/
static const struct json_array_t json_array_10 = {
.element_type = t_integer,
.arr.integers.store = intstore,
.count = &intcount,
.maxlen = sizeof(intstore)/sizeof(intstore[0]),
};
-/*@+type@*/
/* Case 11: Read array of booleans */
@@ -233,14 +224,12 @@ static const char *json_str11 = "[true,false,true]";
static bool boolstore[4];
static int boolcount;
-/*@-type@*/
static const struct json_array_t json_array_11 = {
.element_type = t_boolean,
.arr.booleans.store = boolstore,
.count = &boolcount,
.maxlen = sizeof(boolstore)/sizeof(boolstore[0]),
};
-/*@+type@*/
/* Case 12: Read array of reals */
@@ -248,17 +237,14 @@ static const char *json_str12 = "[23.1,-17.2,5.3]";
static double realstore[4];
static int realcount;
-/*@-type@*/
static const struct json_array_t json_array_12 = {
.element_type = t_real,
.arr.reals.store = realstore,
.count = &realcount,
.maxlen = sizeof(realstore)/sizeof(realstore[0]),
};
-/*@+type@*/
#endif /* JSON_MINIMAL */
-/*@ +fullinitblock @*/
/* *INDENT-ON* */
static void jsontest(int i)