Skip to content

Commit

Permalink
Retire splint from our set of static analyzers.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eric-s-raymond committed Mar 30, 2015
1 parent ecb7e1f commit 28bf371
Show file tree
Hide file tree
Showing 105 changed files with 371 additions and 3,764 deletions.
28 changes: 0 additions & 28 deletions .splintrc

This file was deleted.

1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GPSD project news
Repository head:
Fixed incorrect decode of south latitudes in AIS Type 17 messages.
splint has been retired; this removes almost 2KLOC of annotations.

3.14: 2015-03-14 (Eric S. Raymond <[email protected]>)
The Pi Day release, 3.14 on 3/14 2015 at 9:26. Longer timeouts on test clients.
Expand Down
49 changes: 2 additions & 47 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1435,54 +1435,10 @@ def Utility(target, source, action):
env.Precious(target)
return target

# Report splint warnings
# Note: test_bits.c is unsplintable because of the PRI64 macros.
# If you get preprocessor or fatal errors, add +showscan.
# explicitly force splint to only use our splintrc file
splintopts = "-I/usr/include/libusb-1.0 +quiet +nof -f .splintrc"
if sys.platform.startswith('darwin'):
splintopts = splintopts + " +skip-sys-headers"

# splint does not know about multi-arch, work around that
ma_status, ma = _getstatusoutput('dpkg-architecture -qDEB_HOST_MULTIARCH')
if ma_status == 0:
splintopts = '-I/usr/include/%s %s' %(ma.strip(),splintopts)
env['SPLINTOPTS']=splintopts

def Splint(target,sources, description, params):
return Utility(target,sources+generated_sources,[
'@echo "Running splint on %s..."'%description,
'-splint $SPLINTOPTS %s %s'%(" ".join(params)," ".join(sources)),
])

splint_table = [
('splint-daemon',gpsd_sources,'daemon', ['-exportlocal', '-redef']),
('splint-libgpsd',libgpsd_sources,'libgpsd', ['-exportlocal', '-redef']),
('splint-libgps',libgps_sources,'user-side libraries', ['-exportlocal',
'-fileextensions',
'-redef']),
('splint-cgps',['cgps.c'],'cgps', ['-exportlocal']),
('splint-gpsctl',['gpsctl.c'],'gpsctl', ['']),
('splint-gpsdctl',['gpsdctl.c'],'gpsdctl', ['']),
('splint-gpsmon',gpsmon_sources,'gpsmon', ['-exportlocal']),
('splint-gpspipe',['gpspipe.c'],'gpspipe', ['']),
('splint-gps2udp',['gps2udp.c'],'gps2udp', ['']),
('splint-gpsdecode',['gpsdecode.c'],'gpsdecode', ['']),
('splint-gpxlogger',['gpxlogger.c'],'gpxlogger', ['']),
('splint-ntpshmmon',['ntpshmmon.c'],'ntpshmmon', ['']),
('splint-test_packet',['test_packet.c'],'test_packet test harness', ['']),
('splint-test_mktime',['test_mktime.c'],'test_mktime test harness', ['']),
('splint-test_geoid',['test_geoid.c'],'test_geoid test harness', ['']),
('splint-test_json',['test_json.c'],'test_json test harness', ['']),
]

for (target,sources,description,params) in splint_table:
env.Alias('splint',Splint(target,sources,description,params))

# Putting in all these -U flags speeds up cppcheck and allows it to look
# at configurations we actually care about.
Utility("cppcheck", ["gpsd.h", "packet_names.h"],
"cppcheck -U__UNUSED__ -UUSE_QT -US_SPLINT_S -U__COVERITY__ -U__future__ -ULIMITED_MAX_CLIENTS -ULIMITED_MAX_DEVICES -UAF_UNSPEC -UINADDR_ANY -UFIXED_PORT_SPEED -UFIXED_STOP_BITS -U_WIN32 -U__CYGWIN__ -UPATH_MAX -UHAVE_STRLCAT -UHAVE_STRLCPY -UIPTOS_LOWDELAY -UIPV6_TCLASS -UTCP_NODELAY -UTIOCMIWAIT --template gcc --enable=all --inline-suppr --suppress='*:driver_proto.c' --force $SRCDIR")
"cppcheck -U__UNUSED__ -UUSE_QT -U__COVERITY__ -U__future__ -ULIMITED_MAX_CLIENTS -ULIMITED_MAX_DEVICES -UAF_UNSPEC -UINADDR_ANY -UFIXED_PORT_SPEED -UFIXED_STOP_BITS -U_WIN32 -U__CYGWIN__ -UPATH_MAX -UHAVE_STRLCAT -UHAVE_STRLCPY -UIPTOS_LOWDELAY -UIPV6_TCLASS -UTCP_NODELAY -UTIOCMIWAIT --template gcc --enable=all --inline-suppr --suppress='*:driver_proto.c' --force $SRCDIR")

# Experimental check with clang analyzer
Utility("scan-build", ["gpsd.h", "packet_names.h"],
Expand Down Expand Up @@ -1513,8 +1469,7 @@ Utility("deheader", generated_sources, [

# Perform all local code-sanity checks (but not the Coverity scan).
audit = env.Alias('audit',
['splint',
'cppcheck',
['cppcheck',
'pylint',
'xmllint',
'valgrind-audit',
Expand Down
Loading

0 comments on commit 28bf371

Please sign in to comment.