tech-toolchain archive

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

Re: Building with HAVE_GCC=48 fails on Ubuntu

On Sat, Mar 08, 2014 at 21:42:20 +0000, Patrick Welche wrote:

> As an aside, how is that basename() related to the one declared in libgen.h?
> NetBSD:
> char    *basename(char *);
> Ubuntu 12.04.3:
> extern char *__xpg_basename (char *__path) __THROW;
> #define basename        __xpg_basename
> Even fewer const...

  There  are  two  different  versions  of basename() - the POSIX version
  described above, and the GNU version, which one gets after

      #define _GNU_SOURCE         /* See feature_test_macros(7) */
      #include <string.h>

  The GNU version never modifies its  argument,  and  returns  the  empty
  string  when  path has a trailing slash, and in particular also when it
  is "/".  There is no GNU version of dirname().

  With glibc, one gets the POSIX version of basename() when <libgen.h> is
  included, and the GNU version otherwise.


Home | Main Index | Thread Index | Old Index