gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Lots of warnings


From: Gary E. Miller
Subject: Re: [gpsd-dev] Lots of warnings
Date: Tue, 9 Aug 2016 18:49:52 -0700

Yo Hal!

I pushed some fixes, give it another shot.

On Sat, 06 Aug 2016 02:09:44 -0700
Hal Murray <address@hidden> wrote:

> I thought gpsd was pretty clean, but I guess nobody has been looking 
> carefully.

Clean on my compiler (gcc).  Yours is picky.

> Here is my collection from various systems...  If it matters, I'll
> dig out the version of gcc and the distro.

let's see how far we get first.

> bits.c:40:19: warning: left shift of negative value
> [-Wshift-negative-value] bits.c:71:15: warning: left shift of
> negative value [-Wshift-negative-value]
> bits.c:40:19: warning: left
> shift of negative value [-Wshift-negative-value]
> bits.c:71:15:
> warning: left shift of negative value [-Wshift-negative-value]

I remember Eric had something to say about this one, I'll leave it to him.

> ppscheck.c:58:1: warning: 'static' is not at beginning of declaration
> [-Wold-style-declaration] ppscheck.c:65:6: warning: no previous
> prototype for 'usage' [-Wmissing-prototypes]
> ppscheck.c:118:6: warning: format '%10ld' expects type 'long int',
> but argument 3 has type 'time_t'
> ppscheck.c:129:1: warning: control reaches end of non-void function 
> [-Wreturn-type]

Eric got part of this, I think i got the last one.

> gps2udp.c:302:18: warning: array subscript is above array bounds

Now that is a good catch.  It really could have been an overrun!

> ntpshmmon.c:34:5: warning: implicit declaration of function 'memset'
> ntpshmmon.c:34:5: warning: incompatible implicit declaration of
> built-in function 'memset'

Fixed.

> timespec_str.c:48:12: warning: absolute value function 'labs' given
> an argument of type 'const time_t' (aka 'const long long') but has
> parameter of type 'long' which may cause truncation of value
> [-Wabsolute-value] 

Huh???  time_t is a long!

> driver_nmea0183.c:1255:10: warning: taking the
> absolute value of unsigned type 'unsigned int' has no effect
> [-Wabsolute-value]

Duh.  Fixed.

> gpsd_json.c:1996:13: warning: this 'else' clause does not guard... 
> [-Wmisleading
> -indentation]

Since when was indentation mandatory in C???  Fixed.

> cc1plus: warning: command line option "-Wmissing-declarations" is
> valid for C/ObjC but not for C++

Valid in gcc C++.  Can you come up with a patch do detect your non-gcc
conforming compiler?

> A blizzard from FreeBSD 9.3-RELEASE-p33 i386

Those are just weird...

> and a ffew more

Are we to guess?  Or are they too weird to bother?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

Attachment: pgpeiKtSLprCB.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]