[GRASS5] GRASS 5.1 v.in.ascii bug

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu May 8 08:08:36 EDT 2003


On Thu, 8 May 2003, Radim Blazek wrote:

> On Wednesday 07 May 2003 05:40 pm, Paul Kelly wrote:
> > Out of interest I tried compiling the same module on Linux using gcc and
> > sure enough the warning came up
> > a2b.c:21: warning: `n_points' might be used uninitialized in this function
> >
> > All the new modules seem to generate so many warnings. If we could get rid
> > of them it would probably fix a lot of the bugs as well.
>
> I was not using -Wall first, now (circa one year) I am compiling with
> -Wall and I aim to make a code which compiles without warnings.
> In all vector/* modules, which may be considered as new,
> I have got only 13 warnings (12 uninitialized, 1 unused).
> Did you get more (many) warnings in vector/* modules or in
> others? Did you get more warnings on IRIX?

With gcc on Linux I can confirm I got the same errors as you but
unfortunately on IRIX there were many more:
compiler errors:
21 missing function prototypes
linker errors:
1  ld-defined internal symbol defined by a program
48 multiply-defined symbols
64 library not used for resolving any symbol

I really don't know how to catch these on Linux. I don't think -ansi
helps. The missing function prototypes can be a source of bugs as I
think the SGI cc compiler will assume the return type is an int if there
is no prototype. I don't know how gcc can get by without the function
prototypes though. Does it just assume the return type is the same as the
variable it is being assigned to?

The multiply-defined symbols come from variables in header files not being
declared as extern. I fixed one in lib/vector/rtree that was causing
several screenfuls of warnings for every module that used the vector
library but there are still others there.

Paul




More information about the grass-dev mailing list