Add make_relative_prefix to libiberty

DJ Delorie dj@redhat.com
Mon Nov 18 16:52:00 GMT 2002


> Which header?  I do not see allocation rules, just a list of how
> different functions in libiberty allocate memory.  A number of them use
> xmalloc to do it.  Much simpler for an initialization function like
> this one.

All I'm looking for is a short note in the header where the
declaration is (like "return value must be free'd by caller").

> > You have also changed the copyright terms (GPL -> LGPL).  Do you have
> > the FSF's permission to do so?
> 
> No.  It was just me being sloppy; I apologize.  I copied the wrong
> copyright notice; I think I grabbed it from lbasename.  Since I see a
> number of GPL source files in libiberty, I assume that there is no
> problem with adding a GPL'd source file to the libiberty directory?

Depends.  If this function is primarily for GPL'd applications, I
don't see a problem.  We've had cases where we want the "GPL plus
exception" for libstdc++, but I don't think this is the case.  but we
can't change it anyway, so we might as well keep it GPL.

> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify it under
> +the terms of the GNU General Public License as published by the Free
> +Software Foundation; either version 2, or (at your option) any later
> +version.
> +
> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
> +for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with GCC; see the file COPYING.  If not, write to the Free
> +Software Foundation, 59 Temple Place - Suite 330, Boston, MA
> +02111-1307, USA.  */

Obviously, we shouldn't use "GCC" here ;-)

> +/*
> +
> +@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix})
> +
> +Given pointers to the @code{argv[0]}, the default installation directory
> +for this program, and the default location of another directory, this function
> +returns the path to the other directory assuming the installation tree has moved
> +from @var{bin_prefix} to the new location of @var{progname}.

Hmmm.. could we add a note about the rv's allocation here?

And the big comment above make_relative_prefix itself has the text
which should go here.  That's basically what I did when I did the
original set of docs - just resyntaxed the comments into texinfo.

> +#include "ansidecl.h"
> +#include "libiberty.h"

The Makefile still has dependencies on obstack.h



More information about the Gcc-patches mailing list