On Tue, Nov 28, 2000 at 08:53:00PM -0200, Alexandre Oliva wrote:
> On Nov 28, 2000, Kevin Atkinson <[EMAIL PROTECTED]> wrote:
>
> > On 28 Nov 2000, Alexandre Oliva wrote:
> >> On Nov 28, 2000, Bernard Dautrevaux <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ [EMAIL PROTECTED]
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page: /___/ /___/ gpg public key:
http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc
_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool