[GRASS-dev] fns with the same name -> segfault

Glynn Clements glynn at gclements.plus.com
Mon Mar 24 03:32:16 EDT 2008

Martin Landa wrote:

> v.out.svg --interface-description
> ends with segfault.
> [gcc (GCC) 4.2.3 (Debian 4.2.3-2)]
> After some investigation I found out that the reason is function
> print_escaped_for_xml() in vector/v.out.svg/main.c. Function with the
> same name is also included in lib/gis/parser.c.
> I am not sure about right solution here, I guess changing
> print_escaped_for_xml() in parser.c to be static function...(?)

Yes; fixed in SVN. As well as changing parser.c, I have also changed
all of the functions in vector/v.out.svg/main.c except main().

More generally, functions which aren't meant to be used outside of the
source file where they are defined should be declared "static" to
document this fact.

For modules consisting of a single source file, all functions except
main() should be declared "static".

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list