bug-glibc
[Top][All Lists]
Advanced

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

Re: libgen.h in Turb Linux 11.23


From: Andreas Jaeger
Subject: Re: libgen.h in Turb Linux 11.23
Date: 06 Mar 2001 08:49:34 +0100
User-agent: Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Channel Islands)

Ayad Jassim <address@hidden> writes:

> On turbolinux 11.23 release I am having a 
> problem with /usr/include/libgen.h header file.
> 
> Is this file part of our sgicc compiler?
> It will help me to know how to inquire or file
> a bug on the following issue:

<libgen.h> has:
/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
   This file is part of the GNU C Library.


> Basicly, I have a c routine:
> 
> (Originally the code is much bigger than this.
>  I reduced it to this small code in order to create 
>  this error easily. This used to compile OK on versions
>  prior to TurboLinux 11.23)
> -------------------------------------------------------
> #include <stdio.h>
> #include <stdlib.h>
> 
> typedef struct
> {
>   char  *name, *basename;
> } Patchlist;
> 
> #include <libgen.h>
> 
> void check_list( void)
> {
>   Patchlist *pl;
>   printf( "Checking \"%s\" ... ",pl->basename);
> 
> }
> ----------------------------------------------------------------
> 
> With Turbo Linux 11.23 I get the following error:
> 
> sgicc -c foo.c
> 
> foo.c: In function `check_list':
> foo.c:17: structure has no member named `__xpg_basename'
> 
> I noticed that if I move the line '#include <libgen.h>'
> to above the definition of 'typedef struct ', then
> the code compiles OK.
> 
> I checked on the difference between libgen.h in Turbolinux
> 11.23 versus for example our Nov02 cross compilers
> and I can see what happened:
> 
> In Nov02, libgen.h had some XPG definitions as follows:
> 
> ---------------------------------------------------
> extern char *__xpg_basename __P ((char *__path));
> #define basename(path)  __xpg_basename (path)
> ---------------------------------------------------
> 
> while in Turbolinux 11.23, this changed to
> 
> -----------------------------------------------------
> extern char *__xpg_basename (char *__path) __THROW;
> #define basename        __xpg_basename
> -----------------------------------------------------
> 
> And you can see how the #define basename has now collided
> with the user's 'basename' definition in the user coding
> in struct Patchlist.

That's a bug in the user program, basename is reserved in XPG and
therefore you can't use it as a structure member.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]