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

Re: [ gpsdrive ] List of warnings getting longer.



David wrote:
> 
> Here are two that ring an alarm bell for me.
> 
> map_projection.c:163: warning: 'lon' may be used uninitialized in this
> function
> map_projection.c:163: warning: 'lat' may be used uninitialized in this
> function


yes, in calcxytopos():

if "map_proj" != google, _map, or _top, then lat and lon will be used
uninitialized.

in that case this error is produced:

  else
    printf ("ERROR: calcxytopos: unknown map Projection\n");


I'm not sure if we should set lat,lon (& thus *mylat,*mylon) to 0,0 or
nan,nan instead of just issuing an error message to stdout.

e.g.
  else {
    lat = 0.0/0.0;  /* nan */
    lon = 0.0/0.0;
    fprintf (stderr, "ERROR: calcxytopos: unknown map Projection\n");
  }


another three points:
 - we should send error messages to stderr not stdout via printf()
     fprintf(stderr, "");
 - proj_googlesat lat ~ (py/1.5) in map_projection.c is almost certainly
     wrong.


Hamish
-- 
This message was part of the gpsdrive mailinglist
unsubscribing can be done by sending a mail containing a body of:
-quote--
unsubscribe gpsdrive
-unquote--
to majordomo@warbase.selwerd.nl