Robert Lipe
2015-07-08 18:20:23 UTC
Opening note: If you're a dabbler in programming, there's about a dozen
independent projects laid out below. Each is small - most are a dozens of
lines of code or less and we could use a hand with more contributors in the
code.
adding gpsbabel-code for the bitslingers.
gpsbabel-misc -> bcc for closure on that list.
You're like the third person in ~15 years and millions of downloads to
notice it. :-)
The other warnings originated from the compiler. Apart from "sign-com-
pretty common in code that reads disk files to have to read some bytes and
have some idea what they are but not need them. It's handy to give them a
name. The lat/lon cases were all of the form.
lat = read_N_bytes();
lon = read_N_bytes();
something_important = read_N_bytes()
#if DEBUG
print something_important about lat/lon
#endif
...we have to read those bytes, but if we're not debugging, we don't DO
anything with them. "fixed" by decorating (void).
one "comment" type warning (not sure whether or not these only show up
We should probably turn these off unless someone else wants to do the work
of cleaning these up. I've ripped through the mechanical ones and fixed
them, but I'll scribble notes on the remaining ones that actually need some
thought in the hope that it helps budding Bablers tackle small projects.
(I think I'm traveling 3 of the next 4 weeks...)
types.
find remaining uses of strptime and replace them with QDateTime methods.
Unfortunately, we may have to keep strptime for csv_util because we expose
them in the csv files and the Qt format strings aren't QUITE the same as
the strptime. (Frankly, if it was the only remaining use, I'd go fix our
own style files and remove strptime and just say that's the new scheme...)
jeeps/gpscom.cc: In function âint32 GPS_Command_Send_Course(const char*,
Maybe we should compile that course stuff away totally.
Meta Grouchiness about Jeeps: Can'd decide between CamelCase and
underbar_separators? Why not BOTH!
t has type âcharâ [-Wchar-subscripts]
That should probably be solved "better", but for now, I've added that just
to remove the obstacle for any Cygwin users in the audience. A better fix
would test for the foo64() functions in configure and set the existing
IOAPI_NO_64
manifest and remove my hack.
independent projects laid out below. Each is small - most are a dozens of
lines of code or less and we could use a hand with more contributors in the
code.
adding gpsbabel-code for the bitslingers.
gpsbabel-misc -> bcc for closure on that list.
checking for random stuff to make you feel better... failed
I'm not at all sure what to make of it.
It means I had a theory that nobody ever read that giant wall of text.I'm not at all sure what to make of it.
You're like the third person in ~15 years and millions of downloads to
notice it. :-)
The other warnings originated from the compiler. Apart from "sign-com-
pare" type warnings I got plenty of "unused-but-set-variable" (and it's
a bit enervating to read about set but unused variables like "lat" and
"lon" in a GPS program), a few "char-subscripts", two "array-bounds" and
I checked in r5002 that cleans up a lot of these. All were benign. It'sa bit enervating to read about set but unused variables like "lat" and
"lon" in a GPS program), a few "char-subscripts", two "array-bounds" and
pretty common in code that reads disk files to have to read some bytes and
have some idea what they are but not need them. It's handy to give them a
name. The lat/lon cases were all of the form.
lat = read_N_bytes();
lon = read_N_bytes();
something_important = read_N_bytes()
#if DEBUG
print something_important about lat/lon
#endif
...we have to read those bytes, but if we're not debugging, we don't DO
anything with them. "fixed" by decorating (void).
one "comment" type warning (not sure whether or not these only show up
under Cygwin, so I'll go into the trouble of listing them all here).
It looks like GCC 4.8 has added a bunch of hyperactive warnings to -Wall.We should probably turn these off unless someone else wants to do the work
of cleaning these up. I've ripped through the mechanical ones and fixed
them, but I'll scribble notes on the remaining ones that actually need some
thought in the hope that it helps budding Bablers tackle small projects.
(I think I'm traveling 3 of the next 4 weeks...)
route.cc: In function âvoid track_recompute(const route_head*,
route.cc:664:84: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
if (thisw->GetCreationTime().isValid() &&
(thisw->GetCreationTime().toTime_t() < tdata->start)) {
^
route.cc:668:41: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
if (thisw->creation_time.toTime_t() > tdata->end) {
route.cc should quit using toTime_t. tdata needs to use appropriate dataroute.cc:664:84: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
if (thisw->GetCreationTime().isValid() &&
(thisw->GetCreationTime().toTime_t() < tdata->start)) {
^
route.cc:668:41: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
if (thisw->creation_time.toTime_t() > tdata->end) {
types.
strptime.c:302:5: warning: array subscript has type âcharâ
[-Wchar-subscripts]
if (isspace(*fmt)) {
^
strptime.c:303:7: warning: array subscript has type âcharâ
[-Wchar-subscripts]
while (isspace(*rp)) {
^
strptime.c:520:7: warning: array subscript has type âcharâ
[-Wchar-subscripts]
while (isspace(*rp)) {
^
strptime.c:289:21: warning: variable âeraâ set but not used
[-Wunused-but-set-variable]
struct era_entry *era;
^
strptime.c:277:15: warning: variable ârp_backupâ set but not used
[-Wunused-but-set-variable]
const char *rp_backup;
Should look for an update version of strptime from upstream. Better yet,[-Wchar-subscripts]
if (isspace(*fmt)) {
^
strptime.c:303:7: warning: array subscript has type âcharâ
[-Wchar-subscripts]
while (isspace(*rp)) {
^
strptime.c:520:7: warning: array subscript has type âcharâ
[-Wchar-subscripts]
while (isspace(*rp)) {
^
strptime.c:289:21: warning: variable âeraâ set but not used
[-Wunused-but-set-variable]
struct era_entry *era;
^
strptime.c:277:15: warning: variable ârp_backupâ set but not used
[-Wunused-but-set-variable]
const char *rp_backup;
find remaining uses of strptime and replace them with QDateTime methods.
Unfortunately, we may have to keep strptime for csv_util because we expose
them in the csv files and the Qt format strings aren't QUITE the same as
the strptime. (Frankly, if it was the only remaining use, I'd go fix our
own style files and remove strptime and just say that's the new scheme...)
jeeps/gpsapp.cc:1682:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (gps_time != 0xffffffff && gps_time != 0) {
Cast it or make the constant U ?integer expressions [-Wsign-compare]
if (gps_time != 0xffffffff && gps_time != 0) {
jeeps/gpscom.cc: In function âint32 GPS_Command_Send_Course(const char*,
GPS_SCourse**, GPS_SCourse_Lap**, GPS_STrack**, GPS_SCourse_Point**, int32,
jeeps/gpscom.cc:806:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (n_crs > limits.max_courses
^
jeeps/gpscom.cc:807:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_clp > limits.max_course_laps
^
jeeps/gpscom.cc:808:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_trk > limits.max_course_trk_pnt
^
jeeps/gpscom.cc:809:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_cpt > limits.max_course_pnt) {
This is Gerhard's course stuff; I'm not sure we ever even actually use it.jeeps/gpscom.cc:806:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (n_crs > limits.max_courses
^
jeeps/gpscom.cc:807:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_clp > limits.max_course_laps
^
jeeps/gpscom.cc:808:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_trk > limits.max_course_trk_pnt
^
jeeps/gpscom.cc:809:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
|| n_cpt > limits.max_course_pnt) {
Maybe we should compile that course stuff away totally.
Meta Grouchiness about Jeeps: Can'd decide between CamelCase and
underbar_separators? Why not BOTH!
t has type âcharâ [-Wchar-subscripts]
magproto.cc:750:35: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (current_time().toTime_t() > later) {
Should quit using Time_t. Fix the type for 'later'.integer expressions [-Wsign-compare]
if (current_time().toTime_t() > later) {
nmea.cc:678:8: warning: variable âscnâ set but not used
[-Wunused-but-set-variable]
int scn,cnt;
This was about the only one that indicated an actual bug. Fixed. (weakly)[-Wunused-but-set-variable]
int scn,cnt;
...
For
now,For
adding || defined (__CYGWIN__) to that list probably works. Probably.
Bingo! That DOES in fact work!to remove the obstacle for any Cygwin users in the audience. A better fix
would test for the foo64() functions in configure and set the existing
IOAPI_NO_64
manifest and remove my hack.