1. Some functions in gps.h are not guaranteed to be available.
gps_enable_debug() and libgps_trace() can be compiled out from the shared library libgps.
This occurs when one builds libgps with clientdebug=False.
Thus C client code being built would fail to link on a system where they are not available.
And presumably have a run-time failure when using a pre built client on a system where libgps lacks those functions.
IMHO The functions should always be available, possibly as empty functions if one is concerned about the footprint on minimal systems.
Luckily it seems as though most distributions use the (implicit) default setting of clientdebug=True when building libgps.
2. Incorrect use of gps_close() can cause SIGSEV faults.
Since gps_close() tries to free some privdata in the gps_data_t structure it could fail if privdata has not been initialized (and so could be pointing to a random location and hence cause a
gps_close() should only be called after a successful gps_open() (which has allocated the data).
I don't see a way to prevent this solely within gpsd itself, so probably only the documentation should be updated to reflect the recommended usage.
I can generate patches along the lines I think the solutions should take.
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.