libtool
[Top][All Lists]
Advanced

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

Re: Problem with ltdl.h


From: Gary V. Vaughan
Subject: Re: Problem with ltdl.h
Date: Wed, 29 Nov 2000 00:36:13 +0000
User-agent: Mutt/1.2.5i

On Tue, Nov 28, 2000 at 08:53:00PM -0200, Alexandre Oliva wrote:
> On Nov 28, 2000, Kevin Atkinson <address@hidden> wrote:
> 
> > On 28 Nov 2000, Alexandre Oliva wrote:
> >> On Nov 28, 2000, Bernard Dautrevaux <address@hidden> wrote:
> >> 
> >> > in C++
> >> >  struct lt_dlhandle
> >> > automatically define a TYPENAME i.e. makes an implicit
> >> >  typedef struct lt_dlhandle lt_dlhandle;
> >> 
> >> However, IIRC, it is valid to have the implicit name overridden by
> >> another definition of the name, which is what the `typedef' does.
> 
> > So are you saying that you are not going to fix it.
> 
> Not really.  I'm just asking for better arguments to make me change my
> mind about it :-)
> 
> > It does NOT appear
> > to be valid C++ code
> 
> I've just managed to compile:
> 
> typedef struct foo foo;
> 
> with g++, version 2.95.2.  So it *is* valid C++.  I don't understand
> why G++ is complaining about it.
> 
> If some widely used C++ compiler fails to compile it, for example,
> when ltdl.h is in its standard header-file search path, then we may
> have a good reason to change it.  But first I want to understand the
> problem, so that it can at least be documented.

I introduced this problem when getting rid of the `_t' suffixes, where
the line used to say:

   typedef struct lt_dlhandle *lt_dlhandle_t;
   
which is fine because the explicit typedef has a different name to the
implicit C++ typedef.  Now that the _t has gone, a C++ compiler has
two conflicting definitions for lt_dlhandle:

   typedef struct lt_dlhandle lt_dlhandle_t;
   typedef struct lt_dlhandle *lt_dlhandle_t;
   
The first implicit one created by the compiler and the second from the
code.

I must say that I don't care much for `typedef foo *foo', and would be
happy to remove the inderection and fix all of the exported functions.
I fear this will break the API too radically -- e.g.:

    lt_dlhandle *lt_dlopen (...);
    
Since the struct is an incomplete type anyway, and used like this only
to remove the typecasting inside libltdl that would be necessary if we
used:

   typedef lt_ptr *lt_dlhandle_t;

How about we simply change the name of the struct to lt_handlerecord
or something?

Cheers,
        Gary.
-- 
  ___              _   ___   __              _         mailto: address@hidden
 / __|__ _ _ ___ _| | / / | / /_ _ _  _ __ _| |_  __ _ ___       address@hidden 
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
 \___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page:  /___/                      /___/                  gpg public key:
http://www.oranda.demon.co.uk           http://www.oranda.demon.co.uk/key.asc



reply via email to

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